<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <title>Service Workers 1</title>
  <link href="https://www.w3.org/StyleSheets/TR/2016/W3C-WD" rel="stylesheet" type="text/css">
  <link href="https://www.w3.org/TR/service-workers-1/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-syntax-highlighting */
pre.idl.highlight { color: #708090; }
.highlight:not(.idl) { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
c-[a] { color: #990055 } /* Keyword.Declaration */
c-[b] { color: #990055 } /* Keyword.Type */
c-[c] { color: #708090 } /* Comment */
c-[d] { color: #708090 } /* Comment.Multiline */
c-[e] { color: #0077aa } /* Name.Attribute */
c-[f] { color: #669900 } /* Name.Tag */
c-[g] { color: #222222 } /* Name.Variable */
c-[k] { color: #990055 } /* Keyword */
c-[l] { color: #000000 } /* Literal */
c-[m] { color: #000000 } /* Literal.Number */
c-[n] { color: #0077aa } /* Name */
c-[o] { color: #999999 } /* Operator */
c-[p] { color: #999999 } /* Punctuation */
c-[s] { color: #a67f59 } /* Literal.String */
c-[t] { color: #a67f59 } /* Literal.String.Single */
c-[u] { color: #a67f59 } /* Literal.String.Double */
c-[cp] { color: #708090 } /* Comment.Preproc */
c-[c1] { color: #708090 } /* Comment.Single */
c-[cs] { color: #708090 } /* Comment.Special */
c-[kc] { color: #990055 } /* Keyword.Constant */
c-[kn] { color: #990055 } /* Keyword.Namespace */
c-[kp] { color: #990055 } /* Keyword.Pseudo */
c-[kr] { color: #990055 } /* Keyword.Reserved */
c-[ld] { color: #000000 } /* Literal.Date */
c-[nc] { color: #0077aa } /* Name.Class */
c-[no] { color: #0077aa } /* Name.Constant */
c-[nd] { color: #0077aa } /* Name.Decorator */
c-[ni] { color: #0077aa } /* Name.Entity */
c-[ne] { color: #0077aa } /* Name.Exception */
c-[nf] { color: #0077aa } /* Name.Function */
c-[nl] { color: #0077aa } /* Name.Label */
c-[nn] { color: #0077aa } /* Name.Namespace */
c-[py] { color: #0077aa } /* Name.Property */
c-[ow] { color: #999999 } /* Operator.Word */
c-[mb] { color: #000000 } /* Literal.Number.Bin */
c-[mf] { color: #000000 } /* Literal.Number.Float */
c-[mh] { color: #000000 } /* Literal.Number.Hex */
c-[mi] { color: #000000 } /* Literal.Number.Integer */
c-[mo] { color: #000000 } /* Literal.Number.Oct */
c-[sb] { color: #a67f59 } /* Literal.String.Backtick */
c-[sc] { color: #a67f59 } /* Literal.String.Char */
c-[sd] { color: #a67f59 } /* Literal.String.Doc */
c-[se] { color: #a67f59 } /* Literal.String.Escape */
c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */
c-[si] { color: #a67f59 } /* Literal.String.Interpol */
c-[sx] { color: #a67f59 } /* Literal.String.Other */
c-[sr] { color: #a67f59 } /* Literal.String.Regex */
c-[ss] { color: #a67f59 } /* Literal.String.Symbol */
c-[vc] { color: #0077aa } /* Name.Variable.Class */
c-[vg] { color: #0077aa } /* Name.Variable.Global */
c-[vi] { color: #0077aa } /* Name.Variable.Instance */
c-[il] { color: #000000 } /* Literal.Number.Integer.Long */
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">Service Workers 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">W3C Working Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <div data-fill-with="spec-metadata">
    <dl>
     <dt>This version:
     <dd><a class="u-url" href="https://www.w3.org/TR/1970/WD-service-workers-1-19700101/">https://www.w3.org/TR/1970/WD-service-workers-1-19700101/</a>
     <dt>Latest published version:
     <dd><a href="https://www.w3.org/TR/service-workers-1/">https://www.w3.org/TR/service-workers-1/</a>
     <dt>Editor's Draft:
     <dd><a href="https://w3c.github.io/ServiceWorker/v1/">https://w3c.github.io/ServiceWorker/v1/</a>
     <dt>Previous Versions:
     <dd><a href="https://www.w3.org/TR/2015/WD-service-workers-20150625/" rel="prev">https://www.w3.org/TR/2015/WD-service-workers-20150625/</a>
     <dt class="editor">Editors:
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:slightlyoff@chromium.org">Alex Russell</a> (<span class="p-org org">Google</span>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jungkee.song@samsung.com">Jungkee Song</a> (<span class="p-org org">Samsung Electronics</span>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:jakearchibald@chromium.org">Jake Archibald</a> (<span class="p-org org">Google</span>)
     <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:mek@chromium.org">Marijn Kruisselbrink</a> (<span class="p-org org">Google</span>)
    </dl>
   </div>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="httsp://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document" rel="license">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>This specification describes a method that enables applications to take advantage of persistent background processing, including hooks to enable bootstrapping of web applications while offline.</p>
   <p>The core of this system is an event-driven <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#workers" id="ref-for-workers">Web Worker</a>, which responds to events dispatched from documents and other sources. A system for managing installation, versions, and upgrades is provided.</p>
   <p>The service worker is a generic entry point for event-driven background processing in the Web Platform that is <a href="#extensibility">extensible by other specifications</a>.</p>
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> <em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision of this technical report can be found in the <a href="https://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports index</a> at https://www.w3.org/TR/.</em> </p>
   <p> This document was published by the <a href="https://www.w3.org/WebPlatform/WG/">Web Platform Working Group</a> as a Working Draft. This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation. </p>
   <p></p>
   <p> Feedback and comments on this specification are welcome, please send them to <a href="mailto:public-webapps@w3.org?subject=%5Bservice-workers%5D">public-webapps@w3.org</a> (<a href="mailto:public-webapps@w3.org?subject=subscribe">subscribe</a>, <a href="https://lists.w3.org/Archives/Public/public-webapps/">archives</a>) with <code>[service-workers]</code> at the start of your email’s subject. </p>
   <p> Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. </p>
   <p> This document was produced by a group operating under the <a href="https://www.w3.org/Consortium/Patent-Policy/"><abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="https://www.w3.org/2004/01/pp-impl/83482/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>. </p>
   <p>This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#motivations"><span class="secno">1</span> <span class="content">Motivations</span></a>
    <li>
     <a href="#model"><span class="secno">2</span> <span class="content">Model</span></a>
     <ol class="toc">
      <li>
       <a href="#service-worker-concept"><span class="secno">2.1</span> <span class="content">Service Worker</span></a>
       <ol class="toc">
        <li><a href="#service-worker-lifetime"><span class="secno">2.1.1</span> <span class="content">Lifetime</span></a>
       </ol>
      <li>
       <a href="#service-worker-registration-concept"><span class="secno">2.2</span> <span class="content">Service Worker Registration</span></a>
       <ol class="toc">
        <li><a href="#service-worker-registration-lifetime"><span class="secno">2.2.1</span> <span class="content">Lifetime</span></a>
       </ol>
      <li><a href="#service-worker-client-concept"><span class="secno">2.3</span> <span class="content">Service Worker Client</span></a>
      <li><a href="#selection"><span class="secno">2.4</span> <span class="content">Selection and Use</span></a>
      <li><a href="#task-sources"><span class="secno">2.5</span> <span class="content">Task Sources</span></a>
      <li><a href="#user-agent-shutdown"><span class="secno">2.6</span> <span class="content">User Agent Shutdown</span></a>
     </ol>
    <li>
     <a href="#document-context"><span class="secno">3</span> <span class="content">Client Context</span></a>
     <ol class="toc">
      <li>
       <a href="#service-worker-obj"><span class="secno">3.1</span> <span class="content"><code class="idl"><span>ServiceWorker</span></code></span></a>
       <ol class="toc">
        <li><a href="#service-worker-url"><span class="secno">3.1.1</span> <span class="content"><code class="idl"><span>scriptURL</span></code></span></a>
        <li><a href="#service-worker-state"><span class="secno">3.1.2</span> <span class="content"><code class="idl"><span>state</span></code></span></a>
        <li><a href="#service-worker-postmessage"><span class="secno">3.1.3</span> <span class="content"><code class="idl"><span>postMessage(message, transfer)</span></code></span></a>
        <li><a href="#service-worker-event-handler"><span class="secno">3.1.4</span> <span class="content">Event handler</span></a>
       </ol>
      <li>
       <a href="#service-worker-registration-obj"><span class="secno">3.2</span> <span class="content"><code class="idl"><span>ServiceWorkerRegistration</span></code></span></a>
       <ol class="toc">
        <li><a href="#navigator-service-worker-installing"><span class="secno">3.2.1</span> <span class="content"><code class="idl"><span>installing</span></code></span></a>
        <li><a href="#navigator-service-worker-waiting"><span class="secno">3.2.2</span> <span class="content"><code class="idl"><span>waiting</span></code></span></a>
        <li><a href="#navigator-service-worker-active"><span class="secno">3.2.3</span> <span class="content"><code class="idl"><span>active</span></code></span></a>
        <li><a href="#service-worker-registration-scope"><span class="secno">3.2.4</span> <span class="content"><code class="idl"><span>scope</span></code></span></a>
        <li><a href="#service-worker-registration-update"><span class="secno">3.2.5</span> <span class="content"><code class="idl"><span>update()</span></code></span></a>
        <li><a href="#navigator-service-worker-unregister"><span class="secno">3.2.6</span> <span class="content"><code class="idl"><span>unregister()</span></code></span></a>
        <li><a href="#service-worker-registration-event-handler"><span class="secno">3.2.7</span> <span class="content">Event handler</span></a>
       </ol>
      <li><a href="#navigator-service-worker"><span class="secno">3.3</span> <span class="content"><code class="idl"><span>navigator.serviceWorker</span></code></span></a>
      <li>
       <a href="#service-worker-container"><span class="secno">3.4</span> <span class="content"><code class="idl"><span>ServiceWorkerContainer</span></code></span></a>
       <ol class="toc">
        <li><a href="#navigator-service-worker-controller"><span class="secno">3.4.1</span> <span class="content"><code class="idl"><span>controller</span></code></span></a>
        <li><a href="#navigator-service-worker-ready"><span class="secno">3.4.2</span> <span class="content"><code class="idl"><span>ready</span></code></span></a>
        <li><a href="#navigator-service-worker-register"><span class="secno">3.4.3</span> <span class="content"><code class="idl"><span>register(scriptURL, options)</span></code></span></a>
        <li><a href="#navigator-service-worker-getRegistration"><span class="secno">3.4.4</span> <span class="content"><code class="idl"><span>getRegistration(clientURL)</span></code></span></a>
        <li><a href="#navigator-service-worker-getRegistrations"><span class="secno">3.4.5</span> <span class="content"><code class="idl"><span>getRegistrations()</span></code></span></a>
        <li><a href="#navigator-service-worker-startMessages"><span class="secno">3.4.6</span> <span class="content"><code class="idl"><span>startMessages()</span></code></span></a>
        <li><a href="#service-worker-container-event-handlers"><span class="secno">3.4.7</span> <span class="content">Event handlers</span></a>
       </ol>
      <li>
       <a href="#serviceworkermessage-event-section"><span class="secno">3.5</span> <span class="content"><code class="idl"><span>ServiceWorkerMessageEvent</span></code></span></a>
       <ol class="toc">
        <li><a href="#serviceworkermessage-event-data"><span class="secno">3.5.1</span> <span class="content"><code class="idl"><span>event.data</span></code></span></a>
        <li><a href="#serviceworkermessage-event-origin"><span class="secno">3.5.2</span> <span class="content"><code class="idl"><span>event.origin</span></code></span></a>
        <li><a href="#serviceworkermessage-event-lasteventid"><span class="secno">3.5.3</span> <span class="content"><code class="idl"><span>event.lastEventId</span></code></span></a>
        <li><a href="#serviceworkermessage-event-source"><span class="secno">3.5.4</span> <span class="content"><code class="idl"><span>event.source</span></code></span></a>
        <li><a href="#serviceworkermessage-event-ports"><span class="secno">3.5.5</span> <span class="content"><code class="idl"><span>event.ports</span></code></span></a>
       </ol>
      <li><a href="#document-context-events"><span class="secno">3.6</span> <span class="content">Events</span></a>
     </ol>
    <li>
     <a href="#execution-context"><span class="secno">4</span> <span class="content">Execution Context</span></a>
     <ol class="toc">
      <li>
       <a href="#service-worker-global-scope"><span class="secno">4.1</span> <span class="content"><code class="idl"><span>ServiceWorkerGlobalScope</span></code></span></a>
       <ol class="toc">
        <li><a href="#service-worker-global-scope-clients"><span class="secno">4.1.1</span> <span class="content"><code class="idl"><span>clients</span></code></span></a>
        <li><a href="#service-worker-global-scope-registration"><span class="secno">4.1.2</span> <span class="content"><code class="idl"><span>registration</span></code></span></a>
        <li><a href="#service-worker-global-scope-skipwaiting"><span class="secno">4.1.3</span> <span class="content"><code class="idl"><span>skipWaiting()</span></code></span></a>
        <li><a href="#service-worker-global-scope-event-handlers"><span class="secno">4.1.4</span> <span class="content">Event handlers</span></a>
       </ol>
      <li>
       <a href="#client"><span class="secno">4.2</span> <span class="content"><code class="idl"><span>Client</span></code></span></a>
       <ol class="toc">
        <li><a href="#client-url"><span class="secno">4.2.1</span> <span class="content"><code class="idl"><span>url</span></code></span></a>
        <li><a href="#client-frametype"><span class="secno">4.2.2</span> <span class="content"><code class="idl"><span>frameType</span></code></span></a>
        <li><a href="#client-id"><span class="secno">4.2.3</span> <span class="content"><code class="idl"><span>id</span></code></span></a>
        <li><a href="#client-postmessage"><span class="secno">4.2.4</span> <span class="content"><code class="idl"><span>postMessage(message, transfer)</span></code></span></a>
        <li><a href="#client-visibilitystate"><span class="secno">4.2.5</span> <span class="content"><code class="idl"><span>visibilityState</span></code></span></a>
        <li><a href="#client-focused"><span class="secno">4.2.6</span> <span class="content"><code class="idl"><span>focused</span></code></span></a>
        <li><a href="#client-focus"><span class="secno">4.2.7</span> <span class="content"><code class="idl"><span>focus()</span></code></span></a>
        <li><a href="#client-navigate"><span class="secno">4.2.8</span> <span class="content"><code class="idl"><span>navigate(url)</span></code></span></a>
       </ol>
      <li>
       <a href="#clients"><span class="secno">4.3</span> <span class="content"><code class="idl"><span>Clients</span></code></span></a>
       <ol class="toc">
        <li><a href="#clients-get"><span class="secno">4.3.1</span> <span class="content"><code class="idl"><span>get(id)</span></code></span></a>
        <li><a href="#clients-getall"><span class="secno">4.3.2</span> <span class="content"><code class="idl"><span>matchAll(options)</span></code></span></a>
        <li><a href="#clients-openwindow"><span class="secno">4.3.3</span> <span class="content"><code class="idl"><span>openWindow(url)</span></code></span></a>
        <li><a href="#clients-claim"><span class="secno">4.3.4</span> <span class="content"><code class="idl"><span>claim()</span></code></span></a>
       </ol>
      <li>
       <a href="#extendable-event"><span class="secno">4.4</span> <span class="content"><code class="idl"><span>ExtendableEvent</span></code></span></a>
       <ol class="toc">
        <li><a href="#wait-until-method"><span class="secno">4.4.1</span> <span class="content"><code class="idl"><span>event.waitUntil(f)</span></code></span></a>
       </ol>
      <li>
       <a href="#fetch-event-section"><span class="secno">4.5</span> <span class="content"><code class="idl"><span>FetchEvent</span></code></span></a>
       <ol class="toc">
        <li><a href="#fetch-event-request"><span class="secno">4.5.1</span> <span class="content"><code class="idl"><span>event.request</span></code></span></a>
        <li><a href="#fetch-event-clientid"><span class="secno">4.5.2</span> <span class="content"><code class="idl"><span>event.clientId</span></code></span></a>
        <li><a href="#fetch-event-isreload"><span class="secno">4.5.3</span> <span class="content"><code class="idl"><span>event.isReload</span></code></span></a>
        <li><a href="#fetch-event-respondwith"><span class="secno">4.5.4</span> <span class="content"><code class="idl"><span>event.respondWith(r)</span></code></span></a>
       </ol>
      <li>
       <a href="#extendablemessage-event-section"><span class="secno">4.6</span> <span class="content"><code class="idl"><span>ExtendableMessageEvent</span></code></span></a>
       <ol class="toc">
        <li><a href="#extendablemessage-event-data"><span class="secno">4.6.1</span> <span class="content"><code class="idl"><span>event.data</span></code></span></a>
        <li><a href="#extendablemessage-event-origin"><span class="secno">4.6.2</span> <span class="content"><code class="idl"><span>event.origin</span></code></span></a>
        <li><a href="#extendablemessage-event-lasteventid"><span class="secno">4.6.3</span> <span class="content"><code class="idl"><span>event.lastEventId</span></code></span></a>
        <li><a href="#extendablemessage-event-source"><span class="secno">4.6.4</span> <span class="content"><code class="idl"><span>event.source</span></code></span></a>
        <li><a href="#extendablemessage-event-ports"><span class="secno">4.6.5</span> <span class="content"><code class="idl"><span>event.ports</span></code></span></a>
       </ol>
      <li><a href="#execution-context-events"><span class="secno">4.7</span> <span class="content">Events</span></a>
     </ol>
    <li>
     <a href="#cache-objects"><span class="secno">5</span> <span class="content">Caches</span></a>
     <ol class="toc">
      <li><a href="#cache-constructs"><span class="secno">5.1</span> <span class="content">Constructs</span></a>
      <li><a href="#cache-lifetimes"><span class="secno">5.2</span> <span class="content">Understanding Cache Lifetimes</span></a>
      <li>
       <a href="#self-caches"><span class="secno">5.3</span> <span class="content"><code class="idl"><span>self.caches</span></code></span></a>
       <ol class="toc">
        <li><a href="#global-caches"><span class="secno">5.3.1</span> <span class="content"><code class="idl"><span>caches</span></code></span></a>
       </ol>
      <li>
       <a href="#cache"><span class="secno">5.4</span> <span class="content"><code class="idl"><span>Cache</span></code></span></a>
       <ol class="toc">
        <li><a href="#cache-match"><span class="secno">5.4.1</span> <span class="content"><code class="idl"><span>match(request, options)</span></code></span></a>
        <li><a href="#cache-matchall"><span class="secno">5.4.2</span> <span class="content"><code class="idl"><span>matchAll(request, options)</span></code></span></a>
        <li><a href="#cache-add"><span class="secno">5.4.3</span> <span class="content"><code class="idl"><span>add(request)</span></code></span></a>
        <li><a href="#cache-addAll"><span class="secno">5.4.4</span> <span class="content"><code class="idl"><span>addAll(requests)</span></code></span></a>
        <li><a href="#cache-put"><span class="secno">5.4.5</span> <span class="content"><code class="idl"><span>put(request, response)</span></code></span></a>
        <li><a href="#cache-delete"><span class="secno">5.4.6</span> <span class="content"><code class="idl"><span>delete(request, options)</span></code></span></a>
        <li><a href="#cache-keys"><span class="secno">5.4.7</span> <span class="content"><code class="idl"><span>keys(request, options)</span></code></span></a>
       </ol>
      <li>
       <a href="#cache-storage"><span class="secno">5.5</span> <span class="content"><code class="idl"><span>CacheStorage</span></code></span></a>
       <ol class="toc">
        <li><a href="#cache-storage-match"><span class="secno">5.5.1</span> <span class="content"><code class="idl"><span>match(request, options)</span></code></span></a>
        <li><a href="#cache-storage-has"><span class="secno">5.5.2</span> <span class="content"><code class="idl"><span>has(cacheName)</span></code></span></a>
        <li><a href="#cache-storage-open"><span class="secno">5.5.3</span> <span class="content"><code class="idl"><span>open(cacheName)</span></code></span></a>
        <li><a href="#cache-storage-delete"><span class="secno">5.5.4</span> <span class="content"><code class="idl"><span>delete(cacheName)</span></code></span></a>
        <li><a href="#cache-storage-keys"><span class="secno">5.5.5</span> <span class="content"><code class="idl"><span>keys()</span></code></span></a>
       </ol>
     </ol>
    <li>
     <a href="#security-considerations"><span class="secno">6</span> <span class="content">Security Considerations</span></a>
     <ol class="toc">
      <li><a href="#secure-context"><span class="secno">6.1</span> <span class="content">Secure Context</span></a>
      <li><a href="#content-security-policy"><span class="secno">6.2</span> <span class="content">Content Security Policy</span></a>
      <li>
       <a href="#origin-relativity"><span class="secno">6.3</span> <span class="content">Origin Relativity</span></a>
       <ol class="toc">
        <li><a href="#origin-restriction"><span class="secno">6.3.1</span> <span class="content">Origin restriction</span></a>
        <li><a href="#importscripts"><span class="secno">6.3.2</span> <span class="content"><code class="idl"><span>importScripts(urls)</span></code></span></a>
       </ol>
      <li><a href="#cross-origin-resources"><span class="secno">6.4</span> <span class="content">Cross-Origin Resources and CORS</span></a>
      <li><a href="#implementer-concerns"><span class="secno">6.5</span> <span class="content">Implementer Concerns</span></a>
      <li><a href="#privacy"><span class="secno">6.6</span> <span class="content">Privacy</span></a>
     </ol>
    <li><a href="#storage-considerations"><span class="secno">7</span> <span class="content">Storage Considerations</span></a>
    <li>
     <a href="#extensibility"><span class="secno">8</span> <span class="content">Extensibility</span></a>
     <ol class="toc">
      <li><a href="#extension-to-service-worker-registration"><span class="secno">8.1</span> <span class="content">Define API bound to Service Worker Registration</span></a>
      <li><a href="#extension-to-extendable-event"><span class="secno">8.2</span> <span class="content">Define Functional Event</span></a>
      <li><a href="#extension-to-service-worker-global-scope"><span class="secno">8.3</span> <span class="content">Define Event Handler</span></a>
      <li><a href="#request-functional-event-dispatch"><span class="secno">8.4</span> <span class="content">Request Functional Event Dispatch</span></a>
     </ol>
    <li>
     <a href="#algorithms"><span class="secno"></span> <span class="content">Appendix A: Algorithms</span></a>
     <ol class="toc">
      <li><a href="#create-job-algorithm"><span class="secno"></span> <span class="content">Create Job</span></a>
      <li><a href="#schedule-job-algorithm"><span class="secno"></span> <span class="content">Schedule Job</span></a>
      <li><a href="#run-job-algorithm"><span class="secno"></span> <span class="content">Run Job</span></a>
      <li><a href="#finish-job-algorithm"><span class="secno"></span> <span class="content">Finish Job</span></a>
      <li><a href="#resolve-job-promise-algorithm"><span class="secno"></span> <span class="content">Resolve Job Promise</span></a>
      <li><a href="#reject-job-promise-algorithm"><span class="secno"></span> <span class="content">Reject Job Promise</span></a>
      <li><a href="#register-algorithm"><span class="secno"></span> <span class="content">Register</span></a>
      <li><a href="#update-algorithm"><span class="secno"></span> <span class="content">Update</span></a>
      <li><a href="#soft-update-algorithm"><span class="secno"></span> <span class="content">Soft Update</span></a>
      <li><a href="#installation-algorithm"><span class="secno"></span> <span class="content">Install</span></a>
      <li><a href="#activation-algorithm"><span class="secno"></span> <span class="content">Activate</span></a>
      <li><a href="#run-service-worker-algorithm"><span class="secno"></span> <span class="content">Run Service Worker</span></a>
      <li><a href="#terminate-service-worker-algorithm"><span class="secno"></span> <span class="content">Terminate Service Worker</span></a>
      <li><a href="#on-fetch-request-algorithm"><span class="secno"></span> <span class="content">Handle Fetch</span></a>
      <li><a href="#handle-functional-event-algorithm"><span class="secno"></span> <span class="content">Handle Functional Event</span></a>
      <li><a href="#on-client-unload-algorithm"><span class="secno"></span> <span class="content">Handle Service Worker Client Unload</span></a>
      <li><a href="#on-user-agent-shutdown-algorithm"><span class="secno"></span> <span class="content">Handle User Agent Shutdown</span></a>
      <li><a href="#unregister-algorithm"><span class="secno"></span> <span class="content">Unregister</span></a>
      <li><a href="#set-registration-algorithm"><span class="secno"></span> <span class="content">Set Registration</span></a>
      <li><a href="#clear-registration-algorithm"><span class="secno"></span> <span class="content">Clear Registration</span></a>
      <li><a href="#update-registration-state-algorithm"><span class="secno"></span> <span class="content">Update Registration State</span></a>
      <li><a href="#update-state-algorithm"><span class="secno"></span> <span class="content">Update Worker State</span></a>
      <li><a href="#notify-controller-change-algorithm"><span class="secno"></span> <span class="content">Notify Controller Change</span></a>
      <li><a href="#scope-match-algorithm"><span class="secno"></span> <span class="content">Match Service Worker Registration</span></a>
      <li><a href="#get-registration-algorithm"><span class="secno"></span> <span class="content">Get Registration</span></a>
      <li><a href="#get-newest-worker-algorithm"><span class="secno"></span> <span class="content">Get Newest Worker</span></a>
      <li><a href="#create-client-algorithm"><span class="secno"></span> <span class="content">Create Client</span></a>
      <li><a href="#create-windowclient-algorithm"><span class="secno"></span> <span class="content">Create Window Client</span></a>
      <li><a href="#query-cache-algorithm"><span class="secno"></span> <span class="content">Query Cache</span></a>
      <li><a href="#batch-cache-operations-algorithm"><span class="secno"></span> <span class="content">Batch Cache Operations</span></a>
     </ol>
    <li>
     <a href="#extended-http-headers"><span class="secno"></span> <span class="content">Appendix B: Extended HTTP headers</span></a>
     <ol class="toc">
      <li><a href="#service-worker-script-request"><span class="secno"></span> <span class="content">Service Worker Script Request</span></a>
      <li><a href="#service-worker-script-response"><span class="secno"></span> <span class="content">Service Worker Script Response</span></a>
      <li><a href="#syntax"><span class="secno"></span> <span class="content">Syntax</span></a>
     </ol>
    <li><a href="#acknowledgements"><span class="secno">9</span> <span class="content">Acknowledgements</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content">Conformance</span></a>
     <ol class="toc">
      <li><a href="#conventions"><span class="secno"></span> <span class="content">Document conventions</span></a>
      <li><a href="#conformant-algorithms"><span class="secno"></span> <span class="content">Conformant Algorithms</span></a>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a>
    <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a>
   </ol>
  </nav>
  <main>
   <section>
    <h2 class="heading settled" data-level="1" id="motivations"><span class="secno">1. </span><span class="content">Motivations</span><a class="self-link" href="#motivations"></a></h2>
    <p><em>This section is non-normative.</em></p>
    <p>Web Applications traditionally assume that the network is reachable. This assumption pervades the platform. HTML documents are loaded over HTTP and traditionally fetch all of their sub-resources via subsequent HTTP requests. This places web content at a disadvantage versus other technology stacks.</p>
    <p>The <a href="#dfn-service-worker" id="ref-for-dfn-service-worker">service worker</a> is designed first to redress this balance by providing a Web Worker context, which can be started by a runtime when navigations are about to occur. This event-driven worker is registered against an origin and a path (or pattern), meaning it can be consulted when navigations occur to that location. Events that correspond to network requests are dispatched to the worker and the responses generated by the worker may override default network stack behavior. This puts the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①">service worker</a>, conceptually, between the network and a document renderer, allowing the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②">service worker</a> to provide content for documents, even while offline.</p>
    <p>Web developers familiar with previous attempts to solve the offline problem have reported a deficit of flexibility in those solutions. As a result, the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③">service worker</a> is highly procedural, providing a maximum of flexibility at the price of additional complexity for developers. Part of this complexity arises from the need to keep <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④">service workers</a> responsive in the face of a single-threaded execution model. As a result, APIs exposed by <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤">service workers</a> are almost entirely asynchronous, a pattern familiar in other JavaScript contexts but accentuated here by the need to avoid blocking document and resource loading.</p>
    <p>Developers using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/offline.html#application-cache" id="ref-for-application-cache">HTML5 Application Cache</a> have also <a href="http://alistapart.com/article/application-cache-is-a-douchebag">reported that several attributes</a> of the design contribute to <a href="http://alistapart.com/article/application-cache-is-a-douchebag#section6">unrecoverable errors</a>. A key design principle of the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥">service worker</a> is that errors should <em>always</em> be recoverable. Many details of the update process of <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦">service workers</a> are designed to avoid these hazards.</p>
    <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧">Service workers</a> are started and kept alive by their relationship to events, not documents. This design borrows heavily from developer and vendor experience with <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#shared-workers" id="ref-for-shared-workers">Shared Workers</a> and <a href="https://developer.chrome.com/extensions/background_pages">Chrome Background Pages</a>. A key lesson from these systems is the necessity to time-limit the execution of background processing contexts, both to conserve resources and to ensure that background context loss and restart is top-of-mind for developers. As a result, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨">service workers</a> bear more than a passing resemblance to <a href="https://developer.chrome.com/extensions/event_pages">Chrome Event Pages</a>, the successor to Background Pages. <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪">Service workers</a> may be started by user agents <em>without an attached document</em> and may be killed by the user agent at nearly any time. Conceptually, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①">service workers</a> can be thought of as Shared Workers that can start, process events, and die without ever handling messages from documents. Developers are advised to keep in mind that <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①②">service workers</a> may be started and killed many times a second.</p>
    <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker①③">Service workers</a> are generic, event-driven, time-limited script contexts that run at an origin. These properties make them natural endpoints for a range of runtime services that may outlive the context of a particular document, e.g. handling push notifications, background data synchronization, responding to resource requests from other origins, or receiving centralized updates to expensive-to-calculate data (e.g., geolocation or gyroscope).</p>
   </section>
   <section>
    <h2 class="heading settled" data-level="2" id="model"><span class="secno">2. </span><span class="content">Model</span><a class="self-link" href="#model"></a></h2>
    <section>
     <h3 class="heading settled" data-level="2.1" id="service-worker-concept"><span class="secno">2.1. </span><span class="content">Service Worker</span><a class="self-link" href="#service-worker-concept"></a></h3>
     <p>A <dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-export id="dfn-service-worker">service worker</dfn> is a type of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#workers" id="ref-for-workers①">web worker</a>. A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①④">service worker</a> executes in the registering <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2">origin</a>.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⑤">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-state">state</dfn>, which is one of <em>parsed</em>, <em>installing</em>, <em>installed</em>, <em>activating</em>, <em>activated</em>, and <em>redundant</em>. It is initially <em>parsed</em>.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⑥">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-script-url">script url</dfn> (a <a data-link-type="dfn">URL</a>).</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⑦">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-type">type</dfn> which is either "<code>classic</code>" or "<code>module</code>". Unless stated otherwise, it is "<code>classic</code>".</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⑧">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-containing-service-worker-registration">containing service worker registration</dfn> (a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration">service worker registration</a>), which contains itself.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⑨">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-service-worker-id">id</dfn> (an opaque string), which uniquely identifies itself during the lifetime of its <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration">containing service worker registration</a>.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⓪">service worker</a> is dispatched a set of <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-lifecycle-events">lifecycle events</dfn>, <a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event">install</a> and <a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event">activate</a>, and <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-functional-events">functional events</dfn> including <a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event">fetch</a>.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②①">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-script-resource">script resource</dfn> (a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-script" id="ref-for-concept-script">script</a>), which represents its own script resource. It is initially set to null. A <a href="#dfn-script-resource" id="ref-for-dfn-script-resource">script resource</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-has-ever-been-evaluated-flag">has ever been evaluated flag</dfn>. It is initially unset. A <a href="#dfn-script-resource" id="ref-for-dfn-script-resource②">script resource</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-https-state">HTTPS state</dfn> which is "<code>none</code>", "<code>deprecated</code>", or "<code>modern</code>". Unless stated otherwise, it is "<code>none</code>".</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②②">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-script-resource-map">script resource map</dfn> which is a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type">List</a> of the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①">Record</a> {[[key]], [[value]]} where [[key]] is a <a data-link-type="dfn">URL</a> and [[value]] is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response">response</a>.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②③">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-skip-waiting-flag">skip waiting flag</dfn>. Unless stated otherwise it is unset.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②④">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-imported-scripts-updated-flag">imported scripts updated flag</dfn>. It is initially unset.</p>
     <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⑤">service worker</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker" data-dfn-type="dfn" data-export id="dfn-set-of-event-types-to-handle">set of event types to handle</dfn> whose element type is an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener" id="ref-for-concept-event-listener">event listener</a>’s event type. It is initially set to null.</p>
     <section>
      <h4 class="heading settled" data-level="2.1.1" id="service-worker-lifetime"><span class="secno">2.1.1. </span><span class="content">Lifetime</span><a class="self-link" href="#service-worker-lifetime"></a></h4>
      <p>The lifetime of a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⑥">service worker</a> is tied to the execution lifetime of events and not references held by <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①">service worker clients</a> to the <code><a href="#service-worker-interface" id="ref-for-service-worker-interface">ServiceWorker</a></code> object.</p>
      <p>A user agent <em class="rfc2119" title="MAY">may</em> <a href="#terminate-service-worker-algorithm">terminate</a> <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⑦">service workers</a> at any time it:</p>
      <ul>
       <li>Has no event to handle.
       <li>Detects abnormal operation: such as infinite loops and tasks exceeding imposed time limits (if any) while handling the events.
      </ul>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.2" id="service-worker-registration-concept"><span class="secno">2.2. </span><span class="content">Service Worker Registration</span><a class="self-link" href="#service-worker-registration-concept"></a></h3>
     <p>A <dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-noexport id="dfn-service-worker-registration">service worker registration</dfn> is a tuple of a <a href="#dfn-scope-url" id="ref-for-dfn-scope-url">scope url</a> and a set of <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⑧">service workers</a>, an <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker">installing worker</a>, a <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker">waiting worker</a>, and an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker">active worker</a>. A user agent <em class="rfc2119" title="MAY">may</em> enable many <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①">service worker registrations</a> at a single origin so long as the <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①">scope url</a> of the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②">service worker registration</a> differs. A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③">service worker registration</a> of an identical <a href="#dfn-scope-url" id="ref-for-dfn-scope-url②">scope url</a> when one already exists in the user agent causes the existing <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④">service worker registration</a> to be replaced.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-scope-url">scope url</dfn> (a <a data-link-type="dfn">URL</a>).</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑥">service worker registration</a> has an associated <dfn data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-registration-script-url">registering script url<a class="self-link" href="#dfn-registration-script-url"></a></dfn> (a <a data-link-type="dfn">URL</a>).</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑦">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-installing-worker">installing worker</dfn> (a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker②⑨">service worker</a> or null) whose <a href="#dfn-state" id="ref-for-dfn-state">state</a> is <em>installing</em>. It is initially set to null.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑧">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-waiting-worker">waiting worker</dfn> (a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⓪">service worker</a> or null) whose <a href="#dfn-state" id="ref-for-dfn-state①">state</a> is <em>installed</em>. It is initially set to null.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑨">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-active-worker">active worker</dfn> (a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③①">service worker</a> or null) whose <a href="#dfn-state" id="ref-for-dfn-state②">state</a> is either <em>activating</em> or <em>activated</em>. It is initially set to null.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⓪">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-last-update-check-time">last update check time</dfn>. It is initially set to null.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①①">service worker registration</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-uninstalling-flag">uninstalling flag</dfn>. It is initially unset.</p>
     <p>A <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①②">service worker registration</a> has one or more <dfn class="dfn-paneled" data-dfn-for="service worker registration" data-dfn-type="dfn" data-noexport id="dfn-service-worker-registration-task-queue">task queues</dfn> that back up the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task">tasks</a> from its <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③">active worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop">event loop</a>’s corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue">task queues</a>. (The target task sources for this back up operation are the <a href="#dfn-handle-fetch-task-source" id="ref-for-dfn-handle-fetch-task-source">handle fetch task source</a> and the <a href="#dfn-handle-functional-event-task-source" id="ref-for-dfn-handle-functional-event-task-source">handle functional event task source</a>.) The user agent dumps the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker④">active worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①">tasks</a> to the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①③">service worker registration</a>’s <a href="#dfn-service-worker-registration-task-queue" id="ref-for-dfn-service-worker-registration-task-queue">task queues</a> when the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker⑤">active worker</a> is <a href="#terminate-service-worker-algorithm">terminated</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task">re-queues those tasks</a> to the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker⑥">active worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop①">event loop</a>’s corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue①">task queues</a> when the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker⑦">active worker</a> spins off. Unlike the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue②">task queues</a> owned by <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop②">event loops</a>, the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①④">service worker registration</a>’s <a href="#dfn-service-worker-registration-task-queue" id="ref-for-dfn-service-worker-registration-task-queue①">task queues</a> are not processed by any <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop③">event loops</a> in and of itself.</p>
     <section>
      <h4 class="heading settled" data-level="2.2.1" id="service-worker-registration-lifetime"><span class="secno">2.2.1. </span><span class="content">Lifetime</span><a class="self-link" href="#service-worker-registration-lifetime"></a></h4>
      <p>A user agent <em class="rfc2119" title="MUST">must</em> persistently keep a list of <a href="#register-algorithm">registered</a> <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⑤">service worker registrations</a> unless otherwise they are explicitly <a href="#unregister-algorithm">unregistered</a>. A user agent has a <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map">scope to registration map</a> that stores the entries of the tuple of <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⑥">service worker registration</a>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url③">scope url</a> and the corresponding <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⑦">service worker registration</a>. The lifetime of <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⑧">service worker registrations</a> is beyond that of the <code><a href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface">ServiceWorkerRegistration</a></code> objects which represent them within the lifetime of their corresponding <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②">service worker clients</a>.</p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.3" id="service-worker-client-concept"><span class="secno">2.3. </span><span class="content">Service Worker Client</span><a class="self-link" href="#service-worker-client-concept"></a></h3>
     <p>A <dfn class="dfn-paneled" data-dfn-for data-dfn-type="dfn" data-noexport id="dfn-service-worker-client">service worker client</dfn> is a type of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object">environment settings object</a>.</p>
     <p>A <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③">service worker client</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-active-worker">active worker</dfn> (an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker⑧">active worker</a>) which currently <a href="#dfn-control" id="ref-for-dfn-control">controls</a> it. It is initially set to null.</p>
     <p>A <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④">service worker client</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-id">id</dfn> (an opaque string), which uniquely identifies itself during its lifetime. It is initially set to a new unique value when the corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①">environment settings object</a> that it represents is created.</p>
     <p>A <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client⑤">service worker client</a> has an associated <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-frame-type">frame type</dfn>, which is one of <em>auxiliary</em>, <em>top-level</em>, <em>nested</em>, and <em>none</em>. Unless stated otherwise it is <em>none</em>. </p>
     <p>A <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-window-client">window client</dfn> is a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client⑥">service worker client</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global">global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window">Window</a></code> object.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-dedicatedworker-client">dedicated worker client</dfn> is a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client⑦">service worker client</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①">global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope" id="ref-for-dedicatedworkerglobalscope">DedicatedWorkerGlobalScope</a></code> object.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-sharedworker-client">shared worker client</dfn> is a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client⑧">service worker client</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②">global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope" id="ref-for-sharedworkerglobalscope">SharedWorkerGlobalScope</a></code> object.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-for="service worker client" data-dfn-type="dfn" data-noexport id="dfn-worker-client">worker client</dfn> is either a <a href="#dfn-dedicatedworker-client" id="ref-for-dfn-dedicatedworker-client">dedicated worker client</a> or a <a href="#dfn-sharedworker-client" id="ref-for-dfn-sharedworker-client">shared worker client</a>.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.4" id="selection"><span class="secno">2.4. </span><span class="content">Selection and Use</span><a class="self-link" href="#selection"></a></h3>
     <p>A <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client⑨">service worker client</a> independently <a href="#dfn-service-worker-registration-selection" id="ref-for-dfn-service-worker-registration-selection">selects</a> and <a href="#dfn-use" id="ref-for-dfn-use">uses</a> a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration①⑨">service worker registration</a> for its own loading and its subresources. The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-service-worker-registration-selection">selection</dfn> of a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⓪">service worker registration</a>, upon a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request">non-subresource request</a>, is a process of either <a href="#scope-match-algorithm">matching</a> a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②①">service worker registration</a> from <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map①">scope to registration map</a> or inheriting an existing <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②②">service worker registration</a> from its parent or owner context depending on the request’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url">url</a>.</p>
     <p>When the request’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①">url</a> is not <a data-link-type="dfn">local</a>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⓪">service worker client</a> <a href="#scope-match-algorithm">matches</a> a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②③">service worker registration</a> from <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map②">scope to registration map</a>. That is, the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①①">service worker client</a> attempts to consult a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②④">service worker registration</a> whose <a href="#dfn-scope-url" id="ref-for-dfn-scope-url④">scope url</a> <a href="#scope-match-algorithm">matches</a> its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url">creation url</a>.</p>
     <p>When the request’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url②">url</a> <a data-link-type="dfn">is local</a>, if the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①②">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context" id="ref-for-responsible-browsing-context">responsible browsing context</a> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context" id="ref-for-nested-browsing-context">nested browsing context</a> or the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①③">service worker client</a> is a <a href="#dfn-worker-client" id="ref-for-dfn-worker-client">worker client</a>, the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①④">service worker client</a> inherits the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⑤">service worker registration</a> from its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#parent-browsing-context" id="ref-for-parent-browsing-context">parent browsing context</a>’s environment or one of <a data-link-type="dfn">the worker’s Documents</a>' environment, respectively, if it exists.</p>
     <p>If the <a href="#dfn-service-worker-registration-selection" id="ref-for-dfn-service-worker-registration-selection①">selection</a> was successful, the <a href="#dfn-service-worker-registration-selection" id="ref-for-dfn-service-worker-registration-selection②">selected</a> <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⑥">service worker registration</a>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker⑨">active worker</a> starts to <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-control">control</dfn> the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⑤">service worker client</a>. Otherwise, the flow returns to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch">fetch</a> where it falls back to the default behavior. When a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⑥">service worker client</a> is <a href="#dfn-control" id="ref-for-dfn-control①">controlled</a> by an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⓪">active worker</a>, it is considered that the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⑦">service worker client</a> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-use">using</dfn> the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①①">active worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①">containing service worker registration</a>.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.5" id="task-sources"><span class="secno">2.5. </span><span class="content">Task Sources</span><a class="self-link" href="#task-sources"></a></h3>
     <p>The following additional <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source">task sources</a> are used by <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③②">service workers</a>.</p>
     <dl>
      <dt>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-handle-fetch-task-source">handle fetch task source</dfn>
      <dd>This <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source①">task source</a> is used for <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch">dispatching</a> <a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event①">fetch</a> events to <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③③">service workers</a>.
      <dt>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-handle-functional-event-task-source">handle functional event task source</dfn>
      <dd>
       This <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source②">task source</a> is used for features that <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch①">dispatch</a> other <a href="#dfn-functional-events" id="ref-for-dfn-functional-events">functional</a> events, e.g. <a href="https://w3c.github.io/push-api/#h-the-push-event">push</a> events, to <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③④">service workers</a>. 
       <p class="note" role="note">A user agent may use a separate task source for each functional event type in order to avoid a head-of-line blocking phenomenon for certain functional events. For instance, a user agent may use a different task source for <a href="http://web-alarms.sysapps.org/#firing-task-event-to-service-worker">task</a> events from other task sources.</p>
     </dl>
    </section>
    <section>
     <h3 class="heading settled" data-level="2.6" id="user-agent-shutdown"><span class="secno">2.6. </span><span class="content">User Agent Shutdown</span><a class="self-link" href="#user-agent-shutdown"></a></h3>
     <p>A user agent <em class="rfc2119" title="MUST">must</em> maintain the state of its stored <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⑦">service worker registrations</a> across restarts with the following rules: </p>
     <ul>
      <li>An <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker⑦">installing worker</a> does not persist but discarded. If the <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①">installing worker</a> was the only <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⑤">service worker</a> for the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⑧">service worker registration</a>, the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration②⑨">service worker registration</a> is discarded.
      <li>A <a data-link-type="dfn" href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker⑤">waiting worker</a> promotes to an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①②">active worker</a>.
     </ul>
     <p></p>
     <p>To attain this, the user agent <em class="rfc2119" title="MUST">must</em> invoke <a href="#on-user-agent-shutdown-algorithm">Handle User Agent Shutdown</a> when it terminates.</p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="3" id="document-context"><span class="secno">3. </span><span class="content">Client Context</span><a class="self-link" href="#document-context"></a></h2>
    <div class="example" id="example-251358cd">
     <a class="self-link" href="#example-251358cd"></a> Bootstrapping with a ServiceWorker: 
<pre class="lang-js highlight"><c- c1>// scope defaults to the path the script sits in</c->
<c- c1>// "/" in this example</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/serviceworker.js"</c-><c- p>).</c->then<c- p>(</c->
  <c- a>function</c-><c- p>(</c->registration<c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->log<c- p>(</c-><c- u>"success!"</c-><c- p>);</c->
    <c- k>if</c-> <c- p>(</c->registration<c- p>.</c->installing<c- p>)</c-> <c- p>{</c->
      registration<c- p>.</c->installing<c- p>.</c->postMessage<c- p>(</c-><c- u>"Howdy from your installing page."</c-><c- p>);</c->
    <c- p>}</c->
  <c- p>},</c->
  <c- a>function</c-><c- p>(</c->why<c- p>)</c-> <c- p>{</c->
    console<c- p>.</c->error<c- p>(</c-><c- u>"Installing the worker failed!:"</c-><c- p>,</c-> why<c- p>);</c->
  <c- p>});</c->
</pre>
    </div>
    <section>
     <h3 class="heading settled" data-level="3.1" id="service-worker-obj"><span class="secno">3.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface③⓪">ServiceWorker</a></code></span><a class="self-link" href="#service-worker-obj"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-interface" id="ref-for-service-worker-interface①"><c- g>ServiceWorker</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#service-worker-url-attribute" id="ref-for-service-worker-url-attribute"><c- g>scriptURL</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum"><c- n>ServiceWorkerState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerState" href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute"><c- g>state</c-></a>;
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#service-worker-postmessage-method" id="ref-for-service-worker-postmessage-method"><c- g>postMessage</c-></a>(<c- b>any</c-> <dfn class="idl-code" data-dfn-for="ServiceWorker/postMessage(message, transfer), ServiceWorker/postMessage(message)" data-dfn-type="argument" data-export id="dom-serviceworker-postmessage-message-transfer-message"><code><c- g>message</c-></code><a class="self-link" href="#dom-serviceworker-postmessage-message-transfer-message"></a></dfn>, <c- b>optional</c-> <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object"><c- b>object</c-></a>> <dfn class="idl-code" data-dfn-for="ServiceWorker/postMessage(message, transfer), ServiceWorker/postMessage(message)" data-dfn-type="argument" data-export id="dom-serviceworker-postmessage-message-transfer-transfer"><code><c- g>transfer</c-></code><a class="self-link" href="#dom-serviceworker-postmessage-message-transfer-transfer"></a></dfn>);

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-onstatechange-attribute" id="ref-for-service-worker-onstatechange-attribute"><c- g>onstatechange</c-></a>;
};
<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②"><c- n>ServiceWorker</c-></a> <c- b>implements</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#abstractworker" id="ref-for-abstractworker"><c- n>AbstractWorker</c-></a>;

<c- b>enum</c-> <a class="idl-code" data-link-type="enum" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum①"><c- g>ServiceWorkerState</c-></a> {
  <dfn class="idl-code" data-dfn-for="ServiceWorkerState" data-dfn-type="enum-value" data-export id="dom-serviceworkerstate-installing"><code><c- s>"installing"</c-></code><a class="self-link" href="#dom-serviceworkerstate-installing"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ServiceWorkerState" data-dfn-type="enum-value" data-export id="dom-serviceworkerstate-installed"><code><c- s>"installed"</c-></code><a class="self-link" href="#dom-serviceworkerstate-installed"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ServiceWorkerState" data-dfn-type="enum-value" data-export id="dom-serviceworkerstate-activating"><code><c- s>"activating"</c-></code><a class="self-link" href="#dom-serviceworkerstate-activating"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ServiceWorkerState" data-dfn-type="enum-value" data-export id="dom-serviceworkerstate-activated"><code><c- s>"activated"</c-></code><a class="self-link" href="#dom-serviceworkerstate-activated"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ServiceWorkerState" data-dfn-type="enum-value" data-export id="dom-serviceworkerstate-redundant"><code><c- s>"redundant"</c-></code><a class="self-link" href="#dom-serviceworkerstate-redundant"></a></dfn>
};
</pre>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="interface" data-export id="service-worker-interface"><code>ServiceWorker</code></dfn></code> object represents a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⑥">service worker</a>. Each <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface③">ServiceWorker</a></code> object is associated with a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⑦">service worker</a>. Multiple separate objects implementing the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface④">ServiceWorker</a></code> interface across documents and workers can all be associated with the same <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⑧">service worker</a> simultaneously.</p>
     <p>A <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface⑤">ServiceWorker</a></code> object has an associated <code class="idl"><a data-link-type="idl" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum②">ServiceWorkerState</a></code> object which is itself associated with <a href="#dfn-service-worker" id="ref-for-dfn-service-worker③⑨">service worker</a>’s <a href="#dfn-state" id="ref-for-dfn-state③">state</a>.</p>
     <section>
      <h4 class="heading settled" data-level="3.1.1" id="service-worker-url"><span class="secno">3.1.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-url-attribute" id="ref-for-service-worker-url-attribute①">scriptURL</a></code></span><a class="self-link" href="#service-worker-url"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="attribute" data-export id="service-worker-url-attribute"><code>scriptURL</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⓪">service worker</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer">serialized</a> <a href="#dfn-script-url" id="ref-for-dfn-script-url">script url</a>.</p>
      <div class="example" id="example-7e895b7f">
       <a class="self-link" href="#example-7e895b7f"></a> 
       <p>For example, consider a document created by a navigation to <code>https://example.com/app.html</code> which <a href="#on-fetch-request-algorithm">matches</a> via the following registration call which has been previously executed:</p>
<pre class="lang-js highlight"><c- c1>// Script on the page https://example.com/app.html</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/service_worker.js"</c-><c- p>,</c-> <c- p>{</c-> scope<c- o>:</c-> <c- u>"/"</c-> <c- p>});</c->
</pre>
       <p>The value of <code>navigator.serviceWorker.controller.scriptURL</code> will be "<code>https://example.com/service_worker.js</code>".</p>
      </div>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.1.2" id="service-worker-state"><span class="secno">3.1.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute①">state</a></code></span><a class="self-link" href="#service-worker-state"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="attribute" data-export id="service-worker-state-attribute"><code>state</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value (in <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="enum" data-export id="service-worker-state-enum"><code>ServiceWorkerState</code></dfn> enumeration) to which it was last set.</p>
     </section>
     <section class="algorithm" data-algorithm="service-worker-postmessage">
      <h4 class="heading settled" data-level="3.1.3" id="service-worker-postmessage"><span class="secno">3.1.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-postmessage-method" id="ref-for-service-worker-postmessage-method①">postMessage(message, transfer)</a></code></span><a class="self-link" href="#service-worker-postmessage"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="method" data-export data-lt="postMessage(message, transfer)|postMessage(message)" id="service-worker-postmessage-method"><code>postMessage(<var>message</var>, <var>transfer</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>If the <code class="idl"><a data-link-type="idl" href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute②">state</a></code> attribute value of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object">context object</a> is "<code>redundant</code>", <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw">throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror">InvalidStateError</a></code>" exception and abort these steps. 
       <li>Let <var>serviceWorker</var> be the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④①">service worker</a> represented by the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①">context object</a>.
       <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>serviceWorker</var> as the argument.
       <li>Let <var>destination</var> be the <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface">ServiceWorkerGlobalScope</a></code> object associated with <var>serviceWorker</var>.
       <li>Let <var>targetRealm</var> be <var>destination</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-global-object-realm" id="ref-for-concept-global-object-realm">Realm</a>.
       <li>Let <var>incumbentSettings</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object" id="ref-for-incumbent-settings-object">incumbent settings object</a>, and <var>incumbentGlobal</var> its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global③">global object</a>.
       <li>Let <var>cloneRecord</var> be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer">StructuredCloneWithTransfer</a>(<var>message</var>, <var>transfer</var>, <var>targetRealm</var>). If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①">throws</a> an exception, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②">rethrow</a> that exception and abort these steps.
       <li>Let <var>clonedMessage</var> be <var>cloneRecord</var>.[[Clone]].
       <li>Let <var>newPorts</var> be a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-frozen-array-type" id="ref-for-dfn-frozen-array-type">frozen array</a> consisting of all <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport">MessagePort</a></code> objects in <var>cloneRecord</var>.[[TransferList]], if any, maintaining their relative order.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①">Queue a task</a> that runs the following steps: 
        <ol>
         <li>Create an event <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-interface" id="ref-for-extendablemessage-event-interface">ExtendableMessageEvent</a></code> interface, with the event type <a href="#service-worker-global-scope-message-event" id="ref-for-service-worker-global-scope-message-event">message</a>, which does not bubble and is not cancelable.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-data-attribute" id="ref-for-extendablemessage-event-data-attribute">data</a></code> attribute of <var>e</var> be initialized to <var>clonedMessage</var>.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-origin-attribute" id="ref-for-extendablemessage-event-origin-attribute">origin</a></code> attribute of <var>e</var> be initialized to the <a data-link-type="dfn">Unicode serialization</a> of <var>incumbentSettings</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①">origin</a>.
         <li>If <var>incumbentGlobal</var> is a <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①">ServiceWorkerGlobalScope</a></code> object, let the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-source-attribute" id="ref-for-extendablemessage-event-source-attribute">source</a></code> attribute of <var>e</var> be initialized to a new <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface⑥">ServiceWorker</a></code> object that represents <var>incumbentGlobal</var>’s <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker">service worker</a>.
         <li>Else if <var>incumbentGlobal</var> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window①">Window</a></code> object, let the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-source-attribute" id="ref-for-extendablemessage-event-source-attribute①">source</a></code> attribute of <var>e</var> be initialized to a new <code class="idl"><a data-link-type="idl" href="#window-client-interface" id="ref-for-window-client-interface">WindowClient</a></code> object that represents <var>incumbentGlobal</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context">browsing context</a>.
         <li>Else, let it be initialized to a new <code class="idl"><a data-link-type="idl" href="#client-interface" id="ref-for-client-interface">Client</a></code> object that represents the worker associated with <var>incumbentGlobal</var>.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#extendablemessage-event-ports-attribute" id="ref-for-extendablemessage-event-ports-attribute">ports</a></code> attribute of <var>e</var> be initialized to <var>newPorts</var>.
         <li><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch②">Dispatch</a> <var>e</var> at <var>destination</var>.
        </ol>
        <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task②">task</a> <em class="rfc2119" title="MUST">must</em> use the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source">DOM manipulation task source</a>.</p>
      </ol>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.1.4" id="service-worker-event-handler"><span class="secno">3.1.4. </span><span class="content">Event handler</span><a class="self-link" href="#service-worker-event-handler"></a></h4>
      <p>The following is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers">event handler</a> (and its corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type">event handler event type</a>) that <em class="rfc2119" title="MUST">must</em> be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes">event handler IDL attributes</a>, by all objects implementing <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface⑦">ServiceWorker</a></code> interface:</p>
      <table class="data">
       <thead>
        <tr>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers①">event handler</a>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type①">event handler event type</a>
       <tbody>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="attribute" data-export id="service-worker-onstatechange-attribute"><code>onstatechange</code></dfn>
         <td><code><a href="#service-worker-statechange-event" id="ref-for-service-worker-statechange-event">statechange</a></code>
      </table>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.2" id="service-worker-registration-obj"><span class="secno">3.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface②⓪">ServiceWorkerRegistration</a></code></span><a class="self-link" href="#service-worker-registration-obj"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①"><c- g>ServiceWorkerRegistration</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface⑧"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-installing-attribute" id="ref-for-service-worker-registration-installing-attribute"><c- g>installing</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface⑨"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-waiting-attribute" id="ref-for-service-worker-registration-waiting-attribute"><c- g>waiting</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⓪"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-active-attribute" id="ref-for-service-worker-registration-active-attribute"><c- g>active</c-></a>;

  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#service-worker-registration-scope-attribute" id="ref-for-service-worker-registration-scope-attribute"><c- g>scope</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#service-worker-registration-update-method" id="ref-for-service-worker-registration-update-method"><c- g>update</c-></a>();
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#service-worker-registration-unregister-method" id="ref-for-service-worker-registration-unregister-method"><c- g>unregister</c-></a>();

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-registration-onupdatefound-attribute" id="ref-for-service-worker-registration-onupdatefound-attribute"><c- g>onupdatefound</c-></a>;
};
</pre>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="interface" data-export id="service-worker-registration-interface"><code>ServiceWorkerRegistration</code></dfn></code> object represents a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⓪">service worker registration</a>. Each <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface②">ServiceWorkerRegistration</a></code> object is associated with a <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="dfn" data-noexport id="dfn-service-worker-registration-interface-service-worker-registration">service worker registration</dfn> (a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③①">service worker registration</a>). Multiple separate objects implementing the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface③">ServiceWorkerRegistration</a></code> interface across documents and workers can all be associated with the same <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③②">service worker registration</a> simultaneously.</p>
     <section class="algorithm" data-algorithm="navigator-service-worker-installing">
      <h4 class="heading settled" data-level="3.2.1" id="navigator-service-worker-installing"><span class="secno">3.2.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-installing-attribute" id="ref-for-service-worker-registration-installing-attribute①">installing</a></code></span><a class="self-link" href="#navigator-service-worker-installing"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="service-worker-registration-installing-attribute"><code>installing</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value to which it was last set.</p>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①①">ServiceWorker</a></code> objects returned from this attribute getter that represent the same <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④②">service worker</a> are the same objects.</p>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-waiting">
      <h4 class="heading settled" data-level="3.2.2" id="navigator-service-worker-waiting"><span class="secno">3.2.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-waiting-attribute" id="ref-for-service-worker-registration-waiting-attribute①">waiting</a></code></span><a class="self-link" href="#navigator-service-worker-waiting"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="service-worker-registration-waiting-attribute"><code>waiting</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value to which it was last set.</p>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①②">ServiceWorker</a></code> objects returned from this attribute getter that represent the same <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④③">service worker</a> are the same objects.</p>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-active">
      <h4 class="heading settled" data-level="3.2.3" id="navigator-service-worker-active"><span class="secno">3.2.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-active-attribute" id="ref-for-service-worker-registration-active-attribute①">active</a></code></span><a class="self-link" href="#navigator-service-worker-active"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="service-worker-registration-active-attribute"><code>active</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value to which it was last set.</p>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①③">ServiceWorker</a></code> objects returned from this attribute getter that represent the same <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④④">service worker</a> are the same objects.</p>
     </section>
     <section class="algorithm" data-algorithm="service-worker-registration-scope">
      <h4 class="heading settled" data-level="3.2.4" id="service-worker-registration-scope"><span class="secno">3.2.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-scope-attribute" id="ref-for-service-worker-registration-scope-attribute①">scope</a></code></span><a class="self-link" href="#service-worker-registration-scope"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="service-worker-registration-scope-attribute"><code>scope</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return <a href="#dfn-service-worker-registration-interface-service-worker-registration" id="ref-for-dfn-service-worker-registration-interface-service-worker-registration">service worker registration</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer①">serialized</a> <a href="#dfn-scope-url" id="ref-for-dfn-scope-url⑤">scope url</a>.</p>
      <p class="example" id="example-3bfa9837"><a class="self-link" href="#example-3bfa9837"></a>In the example in section 3.1.1, the value of <code>registration.scope</code>, obtained from <code>navigator.serviceWorker.ready.then(function(registration) { console.log(registration.scope); })</code> for example, will be "<code>https://example.com/</code>".</p>
     </section>
     <section class="algorithm" data-algorithm="service-worker-registration-update">
      <h4 class="heading settled" data-level="3.2.5" id="service-worker-registration-update"><span class="secno">3.2.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-update-method" id="ref-for-service-worker-registration-update-method①">update()</a></code></span><a class="self-link" href="#service-worker-registration-update"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="method" data-export id="service-worker-registration-update-method"><code>update()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>p</var> be a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects">promise</a>.
       <li>Let <var>registration</var> be the <a href="#dfn-service-worker-registration-interface-service-worker-registration" id="ref-for-dfn-service-worker-registration-interface-service-worker-registration①">service worker registration</a>.
       <li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.
       <li>If <var>newestWorker</var> is null, reject <var>p</var> with an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror①">InvalidStateError</a></code>" exception and abort these steps.
       <li>If the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global④">global object</a> <var>globalObject</var> is a <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface②">ServiceWorkerGlobalScope</a></code> object, and <var>globalObject</var>’s associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①">service worker</a>’s <a href="#dfn-state" id="ref-for-dfn-state④">state</a> is <em>installing</em>, reject <var>p</var> with an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror②">InvalidStateError</a></code>" exception and abort these steps.
       <li>Let <var>job</var> be the result of running <a href="#create-job-algorithm">Create Job</a> with <em>update</em>, <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url⑥">scope url</a>, <var>newestWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url①">script url</a>, <var>p</var>, and the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①">relevant settings object</a> <var>client</var>.
       <li>Set <var>job</var>’s <a data-link-type="dfn" href="#dfn-job-worker-type" id="ref-for-dfn-job-worker-type">worker type</a> to <var>newestWorker</var>’s <a data-link-type="dfn" href="#dfn-type" id="ref-for-dfn-type">type</a>.
       <li>Invoke <a href="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.
       <li>Return <var>p</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-unregister">
      <h4 class="heading settled" data-level="3.2.6" id="navigator-service-worker-unregister"><span class="secno">3.2.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-registration-unregister-method" id="ref-for-service-worker-registration-unregister-method①">unregister()</a></code></span><a class="self-link" href="#navigator-service-worker-unregister"></a></h4>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-registration-unregister-method" id="ref-for-service-worker-registration-unregister-method②">unregister()</a></code> method unregisters the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③③">service worker registration</a>. It is important to note that the currently <a href="#dfn-control" id="ref-for-dfn-control②">controlled</a> <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⑧">service worker client</a>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker">active worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration②">containing service worker registration</a> is effective until all the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client①⑨">service worker clients</a> (including itself) using this <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③④">service worker registration</a> unload. That is, the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-unregister-method" id="ref-for-service-worker-registration-unregister-method③">unregister()</a></code> method only affects subsequent <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate">navigations</a>.</p>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="method" data-export id="service-worker-registration-unregister-method"><code>unregister()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>p</var> be a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①">promise</a>.
       <li>Let <var>job</var> be the result of running <a href="#create-job-algorithm">Create Job</a> with <em>unregister</em>, the <a href="#dfn-scope-url" id="ref-for-dfn-scope-url⑦">scope url</a> of the <a href="#dfn-service-worker-registration-interface-service-worker-registration" id="ref-for-dfn-service-worker-registration-interface-service-worker-registration②">service worker registration</a>, null, <var>p</var>, and the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object④">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object②">relevant settings object</a> <var>client</var>.
       <li>Invoke <a href="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.
       <li>Return <var>p</var>.
      </ol>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.2.7" id="service-worker-registration-event-handler"><span class="secno">3.2.7. </span><span class="content">Event handler</span><a class="self-link" href="#service-worker-registration-event-handler"></a></h4>
      <p>The following is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers②">event handler</a> (and its corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type②">event handler event type</a>) that <em class="rfc2119" title="MUST">must</em> be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes①">event handler IDL attributes</a>, by all objects implementing <code><a href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface②①">ServiceWorkerRegistration</a></code> interface:</p>
      <table class="data">
       <thead>
        <tr>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers③">event handler</a>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type③">event handler event type</a>
       <tbody>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="attribute" data-export id="service-worker-registration-onupdatefound-attribute"><code>onupdatefound</code></dfn>
         <td><code><a href="#service-worker-registration-updatefound-event" id="ref-for-service-worker-registration-updatefound-event">updatefound</a></code>
      </table>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.3" id="navigator-service-worker"><span class="secno">3.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#navigator-service-worker-attribute" id="ref-for-navigator-service-worker-attribute">navigator.serviceWorker</a></code></span><a class="self-link" href="#navigator-service-worker"></a></h3>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface"><c- n>ServiceWorkerContainer</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerContainer" href="#navigator-service-worker-attribute" id="ref-for-navigator-service-worker-attribute①"><c- g>serviceWorker</c-></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator"><c- g>WorkerNavigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①"><c- n>ServiceWorkerContainer</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerContainer" href="#navigator-service-worker-attribute" id="ref-for-navigator-service-worker-attribute②"><c- g>serviceWorker</c-></a>;
};
</pre>
     <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Navigator,WorkerNavigator" data-dfn-type="attribute" data-export id="navigator-service-worker-attribute"><code>serviceWorker</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface②">ServiceWorkerContainer</a></code> object that is associated with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑤">context object</a>.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.4" id="service-worker-container"><span class="secno">3.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface③">ServiceWorkerContainer</a></code></span><a class="self-link" href="#service-worker-container"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface④"><c- g>ServiceWorkerContainer</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget②"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①④"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-container-controller-attribute" id="ref-for-service-worker-container-controller-attribute"><c- g>controller</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface④"><c- n>ServiceWorkerRegistration</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<ServiceWorkerRegistration>" href="#service-worker-container-ready-attribute" id="ref-for-service-worker-container-ready-attribute"><c- g>ready</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑤"><c- n>ServiceWorkerRegistration</c-></a>> <a class="idl-code" data-link-type="method" href="#service-worker-container-register-method" id="ref-for-service-worker-container-register-method"><c- g>register</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerContainer/register(scriptURL, options), ServiceWorkerContainer/register(scriptURL)" data-dfn-type="argument" data-export id="dom-serviceworkercontainer-register-scripturl-options-scripturl"><code><c- g>scriptURL</c-></code><a class="self-link" href="#dom-serviceworkercontainer-register-scripturl-options-scripturl"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-serviceworkercontainer-registrationoptions" id="ref-for-dictdef-serviceworkercontainer-registrationoptions"><c- n>RegistrationOptions</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerContainer/register(scriptURL, options), ServiceWorkerContainer/register(scriptURL)" data-dfn-type="argument" data-export id="dom-serviceworkercontainer-register-scripturl-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-serviceworkercontainer-register-scripturl-options-options"></a></dfn>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject③"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#service-worker-container-getregistration-method" id="ref-for-service-worker-container-getregistration-method"><c- g>getRegistration</c-></a>(<c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerContainer/getRegistration(clientURL), ServiceWorkerContainer/getRegistration()" data-dfn-type="argument" data-export id="dom-serviceworkercontainer-getregistration-clienturl-clienturl"><code><c- g>clientURL</c-></code><a class="self-link" href="#dom-serviceworkercontainer-getregistration-clienturl-clienturl"></a></dfn> = "");
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject④"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑥"><c- n>ServiceWorkerRegistration</c-></a>>> <a class="idl-code" data-link-type="method" href="#service-worker-container-getregistrations-method" id="ref-for-service-worker-container-getregistrations-method"><c- g>getRegistrations</c-></a>();

  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#service-worker-container-startMessages-method" id="ref-for-service-worker-container-startMessages-method"><c- g>startMessages</c-></a>();


  // events
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-container-oncontrollerchange-attribute" id="ref-for-service-worker-container-oncontrollerchange-attribute"><c- g>oncontrollerchange</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-container-onmessage-attribute" id="ref-for-service-worker-container-onmessage-attribute"><c- g>onmessage</c-></a>; // event.source of message events is ServiceWorker object
};
</pre>
<pre class="idl highlight def" id="registration-option-list-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="dictionary" data-export id="dictdef-serviceworkercontainer-registrationoptions"><code><c- g>RegistrationOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="RegistrationOptions" data-dfn-type="dict-member" data-export data-type="USVString " id="dom-registrationoptions-scope"><code><c- g>scope</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#workertype" id="ref-for-workertype"><c- n>WorkerType</c-></a> <dfn class="idl-code" data-default="&quot;classic&quot;" data-dfn-for="RegistrationOptions" data-dfn-type="dict-member" data-export data-type="WorkerType " id="dom-registrationoptions-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-registrationoptions-type"></a></dfn> = "classic";
};
</pre>
     <p>The user agent <em class="rfc2119" title="MUST">must</em> create a <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface⑤">ServiceWorkerContainer</a></code> object when a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator①">Navigator</a></code> object or a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator①">WorkerNavigator</a></code> object is created and associate it with that object.</p>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="interface" data-export id="service-worker-container-interface"><code>ServiceWorkerContainer</code></dfn></code> provides capabilities to register, unregister, and update the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⑤">service worker registrations</a>, and provides access to the state of the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⑥">service worker registrations</a> and their associated <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⑤">service workers</a>.</p>
     <p>A <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface⑥">ServiceWorkerContainer</a></code> has an associated <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerContainer" data-dfn-type="dfn" data-noexport id="dfn-service-worker-container-interface-client">service worker client</dfn>, which is a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⓪">service worker client</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global⑤">global object</a> is associated with the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator②">Navigator</a></code> object or the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator②">WorkerNavigator</a></code> object that the <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface⑦">ServiceWorkerContainer</a></code> is retrieved from.</p>
     <p>A <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface⑧">ServiceWorkerContainer</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerContainer" data-dfn-type="dfn" data-noexport id="dfn-ready-promise">ready promise</dfn> (a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②">promise</a>). It is initially set to a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③">promise</a>.</p>
     <p>A <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface⑨">ServiceWorkerContainer</a></code> object has a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source③">task source</a> called the <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerContainer" data-dfn-type="dfn" data-noexport id="dfn-client-message-queue">client message queue</dfn>, initially empty. A <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue">client message queue</a> can be enabled or disabled, and is initially disabled. When a <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①⓪">ServiceWorkerContainer</a></code> object’s <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue①">client message queue</a> is enabled, the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop④">event loop</a> <em class="rfc2119" title="MUST">must</em> use it as one of its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source④">task sources</a>. When the <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①①">ServiceWorkerContainer</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global">relevant global object</a> is a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window②">Window</a></code> object, all <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task③">tasks</a> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②">queued</a> on its <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue②">client message queue</a> <em class="rfc2119" title="MUST">must</em> be associated with its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object③">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document" id="ref-for-responsible-document">responsible document</a>.</p>
     <section class="algorithm" data-algorithm="navigator-service-worker-controller">
      <h4 class="heading settled" data-level="3.4.1" id="navigator-service-worker-controller"><span class="secno">3.4.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-controller-attribute" id="ref-for-service-worker-container-controller-attribute①">controller</a></code></span><a class="self-link" href="#navigator-service-worker-controller"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="attribute" data-export id="service-worker-container-controller-attribute"><code>controller</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>client</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑥">context object</a>’s <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client">service worker client</a>.
       <li>Return the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①⑤">ServiceWorker</a></code> object that represents <var>client</var>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker①">active worker</a>.
      </ol>
      <p class="note" role="note"><code class="idl"><a data-link-type="idl" href="#service-worker-container-controller-attribute" id="ref-for-service-worker-container-controller-attribute②">navigator.serviceWorker.controller</a></code> returns <code>null</code> if the request is a force refresh (shift+refresh). The <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①⑥">ServiceWorker</a></code> objects returned from this attribute getter that represent the same <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⑥">service worker</a> are the same objects.</p>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-ready">
      <h4 class="heading settled" data-level="3.4.2" id="navigator-service-worker-ready"><span class="secno">3.4.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-ready-attribute" id="ref-for-service-worker-container-ready-attribute①">ready</a></code></span><a class="self-link" href="#navigator-service-worker-ready"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="attribute" data-export id="service-worker-container-ready-attribute"><code>ready</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>If the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑦">context object</a>’s <a href="#dfn-ready-promise" id="ref-for-dfn-ready-promise">ready promise</a> is settled, return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑧">context object</a>’s <a href="#dfn-ready-promise" id="ref-for-dfn-ready-promise①">ready promise</a>.
       <li>Let <var>client</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object⑨">context object</a>’s <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client①">service worker client</a>.
       <li>Let <var>registration</var> be null.
       <li>Let <var>clientURL</var> be <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url①">creation url</a>.
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel">in parallel</a>: 
        <ol>
         <li>
          <em>CheckRegistration</em>: If the result of running <a href="#scope-match-algorithm">Match Service Worker Registration</a> algorithm with <var>clientURL</var> as its argument is not null, then: 
          <ol>
           <li>Set <var>registration</var> to the result value.
          </ol>
         <li>
          Else: 
          <ol>
           <li>Wait until <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map③">scope to registration map</a> has a new entry.
           <li>Jump to the step labeled <em>CheckRegistration</em>.
          </ol>
         <li>
          If <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①③">active worker</a> is null, wait until <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①④">active worker</a> changes. 
          <p class="note" role="note">Implementers should consider this condition is met when the corresponding registration request gets to the step 6 of <a href="#activation-algorithm">Activate</a> algorithm.</p>
         <li>Resolve <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⓪">context object</a>’s <a href="#dfn-ready-promise" id="ref-for-dfn-ready-promise②">ready promise</a> with the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑦">ServiceWorkerRegistration</a></code> object which represents <var>registration</var>.
        </ol>
       <li>Return <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①①">context object</a>’s <a href="#dfn-ready-promise" id="ref-for-dfn-ready-promise③">ready promise</a>.
      </ol>
      <p class="note" role="note">When the <code><a href="#service-worker-container-ready-attribute" id="ref-for-service-worker-container-ready-attribute③">ready</a></code> attribute is accessed, the returned <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④">promise</a> will never reject. Instead, it waits until the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤">promise</a> resolves with a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⑦">service worker registration</a> that has an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⑤">active worker</a>.</p>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-register">
      <h4 class="heading settled" data-level="3.4.3" id="navigator-service-worker-register"><span class="secno">3.4.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-register-method" id="ref-for-service-worker-container-register-method①">register(scriptURL, options)</a></code></span><a class="self-link" href="#navigator-service-worker-register"></a></h4>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-container-register-method" id="ref-for-service-worker-container-register-method②">register(scriptURL, options)</a></code> method creates or updates a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⑧">service worker registration</a> for the given <a href="#dfn-scope-url" id="ref-for-dfn-scope-url⑧">scope url</a>. If successful, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration③⑨">service worker registration</a> ties the provided <var>scriptURL</var> to a <a href="#dfn-scope-url" id="ref-for-dfn-scope-url⑨">scope url</a>, which is subsequently used for <a href="#on-fetch-request-algorithm">navigation matching</a>.</p>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="method" data-export data-lt="register(scriptURL, options)|register(scriptURL)" id="service-worker-container-register-method"><code>register(<var>scriptURL</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>p</var> be a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑥">promise</a>.
       <li>Let <var>client</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①②">context object</a>’s <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client②">service worker client</a>.
       <li>Let <var>scriptURL</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser">parsing</a> <var>scriptURL</var> with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①③">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object④">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url">API base URL</a>.
       <li>If <var>scriptURL</var> is failure, reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>If <var>scriptURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>If any of the strings in <var>scriptURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path" id="ref-for-concept-url-path">path</a> contains either <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive">ASCII case-insensitive</a> "<code>%2f</code>" or <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive①">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>Let <var>scopeURL</var> be null.
       <li>
        If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-registrationoptions-scope" id="ref-for-dom-registrationoptions-scope">scope</a></code> is <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-present" id="ref-for-dfn-present">not present</a>, set <var>scopeURL</var> to the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser①">parsing</a> a string "<code>./</code>" with <var>scriptURL</var>. 
        <p class="note" role="note">The scope url for the registration is set to the location of the service worker script by default.</p>
       <li>Else, set <var>scopeURL</var> to the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser②">parsing</a> <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-registrationoptions-scope" id="ref-for-dom-registrationoptions-scope①">scope</a></code> with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①④">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑤">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url①">API base URL</a>.
       <li>If <var>scopeURL</var> is failure, reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>If <var>scopeURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme①">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>If any of the strings in <var>scopeURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path" id="ref-for-concept-url-path①">path</a> contains either <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive②">ASCII case-insensitive</a> "<code>%2f</code>" or <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive③">ASCII case-insensitive</a> "<code>%5c</code>", reject <var>p</var> with a <code>TypeError</code> and abort these steps.
       <li>Let <var>job</var> be the result of running <a href="#create-job-algorithm">Create Job</a> with <em>register</em>, <var>scopeURL</var>, <var>scriptURL</var>, <var>p</var>, and <var>client</var>.
       <li>Invoke <a href="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.
       <li>Return <var>p</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-getRegistration">
      <h4 class="heading settled" data-level="3.4.4" id="navigator-service-worker-getRegistration"><span class="secno">3.4.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-getregistration-method" id="ref-for-service-worker-container-getregistration-method①">getRegistration(clientURL)</a></code></span><a class="self-link" href="#navigator-service-worker-getRegistration"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="method" data-export data-lt="getRegistration(clientURL)|getRegistration()" id="service-worker-container-getregistration-method"><code>getRegistration(<var>clientURL</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>client</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑤">context object</a>’s <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client③">service worker client</a>.
       <li>Let <var>clientURL</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser③">parsing</a> <var>clientURL</var> with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑥">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑥">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url②">API base URL</a>.
       <li>If <var>clientURL</var> is failure, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑦">promise</a> rejected with a <code>TypeError</code>.
       <li>If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②">origin</a> of <var>clientURL</var> is not <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③">origin</a>, return a <var>promise</var> rejected with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror">SecurityError</a></code>" exception.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑧">promise</a>.
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①">in parallel</a>: 
        <ol>
         <li>Let <var>registration</var> be the result of running <a href="#scope-match-algorithm">Match Service Worker Registration</a> algorithm with <var>clientURL</var> as its argument.
         <li>
          If <var>registration</var> is not null, then: 
          <ol>
           <li>Resolve <var>promise</var> with the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑧">ServiceWorkerRegistration</a></code> object which represents <var>registration</var>.
          </ol>
         <li>
          Else: 
          <ol>
           <li>Resolve <var>promise</var> with undefined.
          </ol>
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-getRegistrations">
      <h4 class="heading settled" data-level="3.4.5" id="navigator-service-worker-getRegistrations"><span class="secno">3.4.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-getregistrations-method" id="ref-for-service-worker-container-getregistrations-method①">getRegistrations()</a></code></span><a class="self-link" href="#navigator-service-worker-getRegistrations"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="method" data-export id="service-worker-container-getregistrations-method"><code>getRegistrations()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>client</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑦">context object</a>’s <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client④">service worker client</a>.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑨">promise</a>.
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②">in parallel</a>: 
        <ol>
         <li>Let <var>array</var> be an empty array.
         <li>
          For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type②">Record</a> {[[key]], [[value]]} <var>entry</var> of <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map④">scope to registration map</a>: 
          <ol>
           <li>If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2④">origin</a> of the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser④">parsing</a> <var>entry</var>.[[key]] is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin">same</a> as <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2⑤">origin</a>, and <var>entry</var>.[[value]]'s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag">uninstalling flag</a> is unset, add the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑨">ServiceWorkerRegistration</a></code> object associated with <var>entry</var>.[[value]] to the <var>array</var>.
          </ol>
         <li>Resolve <var>promise</var> with <var>array</var>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="navigator-service-worker-startMessages">
      <h4 class="heading settled" data-level="3.4.6" id="navigator-service-worker-startMessages"><span class="secno">3.4.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-container-startMessages-method" id="ref-for-service-worker-container-startMessages-method①">startMessages()</a></code></span><a class="self-link" href="#navigator-service-worker-startMessages"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="method" data-export id="service-worker-container-startMessages-method"><code>startMessages()</code></dfn> method <em class="rfc2119" title="MUST">must</em> enable the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑧">context object</a>’s <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue③">client message queue</a> if it is not enabled.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.4.7" id="service-worker-container-event-handlers"><span class="secno">3.4.7. </span><span class="content">Event handlers</span><a class="self-link" href="#service-worker-container-event-handlers"></a></h4>
      <p>The following are the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers④">event handlers</a> (and their corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type④">event handler event types</a>) that <em class="rfc2119" title="MUST">must</em> be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes②">event handler IDL attributes</a>, by all objects implementing the <a href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①⑥">ServiceWorkerContainer</a> interface:</p>
      <table class="data">
       <thead>
        <tr>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers⑤">event handler</a>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type⑤">event handler event type</a>
       <tbody>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="attribute" data-export id="service-worker-container-oncontrollerchange-attribute"><code>oncontrollerchange</code></dfn>
         <td><code><a href="#service-worker-container-controllerchange-event" id="ref-for-service-worker-container-controllerchange-event">controllerchange</a></code>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="attribute" data-export id="service-worker-container-onmessage-attribute"><code>onmessage</code></dfn>
         <td><code><a href="#service-worker-container-message-event" id="ref-for-service-worker-container-message-event">message</a></code>
      </table>
      <p>The first time the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object①⑨">context object</a>’s <a href="#service-worker-container-onmessage-attribute" id="ref-for-service-worker-container-onmessage-attribute②">onmessage</a> IDL attribute is set, its <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue④">client message queue</a> <em class="rfc2119" title="MUST">must</em> be enabled.</p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.5" id="serviceworkermessage-event-section"><span class="secno">3.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-interface" id="ref-for-serviceworkermessage-event-interface">ServiceWorkerMessageEvent</a></code></span><a class="self-link" href="#serviceworkermessage-event-section"></a></h3>
<pre class="idl highlight def">[<dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="constructor" data-export data-lt="ServiceWorkerMessageEvent(type, eventInitDict)|ServiceWorkerMessageEvent(type)" id="dom-serviceworkermessageevent-serviceworkermessageevent"><code><c- g>Constructor</c-></code><a class="self-link" href="#dom-serviceworkermessageevent-serviceworkermessageevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEvent/ServiceWorkerMessageEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-serviceworkermessageevent-serviceworkermessageeventinit" id="ref-for-dictdef-serviceworkermessageevent-serviceworkermessageeventinit"><c- n>ServiceWorkerMessageEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEvent/ServiceWorkerMessageEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-eventinitdict"></a></dfn>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#serviceworkermessage-event-interface" id="ref-for-serviceworkermessage-event-interface①"><c- g>ServiceWorkerMessageEvent</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event"><c- n>Event</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#serviceworkermessage-event-data-attribute" id="ref-for-serviceworkermessage-event-data-attribute"><c- g>data</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#serviceworkermessage-event-origin-attribute" id="ref-for-serviceworkermessage-event-origin-attribute"><c- g>origin</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#serviceworkermessage-event-lasteventid-attribute" id="ref-for-serviceworkermessage-event-lasteventid-attribute"><c- g>lastEventId</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> (<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⑦"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport①"><c- n>MessagePort</c-></a>)? <a class="idl-code" data-link-type="attribute" data-readonly data-type="(ServiceWorker or MessagePort)?" href="#serviceworkermessage-event-source-attribute" id="ref-for-serviceworkermessage-event-source-attribute"><c- g>source</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport②"><c- n>MessagePort</c-></a>>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<MessagePort>?" href="#serviceworkermessage-event-ports-attribute" id="ref-for-serviceworkermessage-event-ports-attribute"><c- g>ports</c-></a>;
};
</pre>
<pre class="idl highlight def" id="serviceworkermessage-event-init-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="dictionary" data-export id="dictdef-serviceworkermessageevent-serviceworkermessageeventinit"><code><c- g>ServiceWorkerMessageEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit"><c- n>EventInit</c-></a> {
  <c- b>any</c-> <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEventInit" data-dfn-type="dict-member" data-export data-type="any " id="dom-serviceworkermessageeventinit-data"><code><c- g>data</c-></code><a class="self-link" href="#dom-serviceworkermessageeventinit-data"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-serviceworkermessageeventinit-origin"><code><c- g>origin</c-></code><a class="self-link" href="#dom-serviceworkermessageeventinit-origin"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-serviceworkermessageeventinit-lasteventid"><code><c- g>lastEventId</c-></code><a class="self-link" href="#dom-serviceworkermessageeventinit-lasteventid"></a></dfn>;
  (<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⑧"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport③"><c- n>MessagePort</c-></a>)? <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEventInit" data-dfn-type="dict-member" data-export data-type="(ServiceWorker or MessagePort)? " id="dom-serviceworkermessageeventinit-source"><code><c- g>source</c-></code><a class="self-link" href="#dom-serviceworkermessageeventinit-source"></a></dfn>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport④"><c- n>MessagePort</c-></a>>? <dfn class="idl-code" data-dfn-for="ServiceWorkerMessageEventInit" data-dfn-type="dict-member" data-export data-type="sequence<MessagePort>? " id="dom-serviceworkermessageeventinit-ports"><code><c- g>ports</c-></code><a class="self-link" href="#dom-serviceworkermessageeventinit-ports"></a></dfn>;
};
</pre>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⑦">Service workers</a> define the <a href="#service-worker-container-message-event" id="ref-for-service-worker-container-message-event①">message</a> event that extends the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/indices.html#event-message" id="ref-for-event-message">message</a></code> event defined in <a data-link-type="biblio" href="#biblio-html">[HTML]</a> to allow setting a <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface①⑨">ServiceWorker</a></code> object as the source of the message. For the <a href="#service-worker-container-message-event" id="ref-for-service-worker-container-message-event②">message</a> event, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⑧">service workers</a> use the <code><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="interface" data-export id="serviceworkermessage-event-interface"><code>ServiceWorkerMessageEvent</code></dfn></code> interface.</p>
     <section>
      <h4 class="heading settled" data-level="3.5.1" id="serviceworkermessage-event-data"><span class="secno">3.5.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-data-attribute" id="ref-for-serviceworkermessage-event-data-attribute①">event.data</a></code></span><a class="self-link" href="#serviceworkermessage-event-data"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="attribute" data-export id="serviceworkermessage-event-data-attribute"><code>data</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the message being sent.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.5.2" id="serviceworkermessage-event-origin"><span class="secno">3.5.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-origin-attribute" id="ref-for-serviceworkermessage-event-origin-attribute①">event.origin</a></code></span><a class="self-link" href="#serviceworkermessage-event-origin"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="attribute" data-export id="serviceworkermessage-event-origin-attribute"><code>origin</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to the empty string. It represents the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2⑥">origin</a> of the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker④⑨">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object②">environment settings object</a> from which the message is sent.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.5.3" id="serviceworkermessage-event-lasteventid"><span class="secno">3.5.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-lasteventid-attribute" id="ref-for-serviceworkermessage-event-lasteventid-attribute①">event.lastEventId</a></code></span><a class="self-link" href="#serviceworkermessage-event-lasteventid"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="attribute" data-export id="serviceworkermessage-event-lasteventid-attribute"><code>lastEventId</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to the empty string.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.5.4" id="serviceworkermessage-event-source"><span class="secno">3.5.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-source-attribute" id="ref-for-serviceworkermessage-event-source-attribute①">event.source</a></code></span><a class="self-link" href="#serviceworkermessage-event-source"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="attribute" data-export id="serviceworkermessage-event-source-attribute"><code>source</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the <code><a href="#service-worker-interface" id="ref-for-service-worker-interface③①">ServiceWorker</a></code> object whose associated <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⓪">service worker</a> the message is sent from.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="3.5.5" id="serviceworkermessage-event-ports"><span class="secno">3.5.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-ports-attribute" id="ref-for-serviceworkermessage-event-ports-attribute①">event.ports</a></code></span><a class="self-link" href="#serviceworkermessage-event-ports"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerMessageEvent" data-dfn-type="attribute" data-export id="serviceworkermessage-event-ports-attribute"><code>ports</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑤">MessagePort</a></code> array being sent, if any.</p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="3.6" id="document-context-events"><span class="secno">3.6. </span><span class="content">Events</span><a class="self-link" href="#document-context-events"></a></h3>
     <p>The following event is dispatched on <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②⓪">ServiceWorker</a></code> object:</p>
     <table class="data">
      <thead>
       <tr>
        <th>Event name
        <th>Interface
        <th>Dispatched when…
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorker" data-dfn-type="event" data-export id="service-worker-statechange-event"><code>statechange</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event" id="ref-for-event①">Event</a></code>
        <td>The <code class="idl"><a data-link-type="idl" href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute③">state</a></code> attribute of the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②①">ServiceWorker</a></code> object is changed.
     </table>
     <p>The following event is dispatched on <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⓪">ServiceWorkerRegistration</a></code> object:</p>
     <table class="data">
      <thead>
       <tr>
        <th>Event name
        <th>Interface
        <th>Dispatched when…
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerRegistration" data-dfn-type="event" data-export id="service-worker-registration-updatefound-event"><code>updatefound</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event" id="ref-for-event②">Event</a></code>
        <td>The <a href="#dfn-service-worker-registration-interface-service-worker-registration" id="ref-for-dfn-service-worker-registration-interface-service-worker-registration③">service worker registration</a>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker⑧">installing worker</a> changes. (See step 8 of the <a href="#installation-algorithm">Install</a> algorithm.)
     </table>
     <p>The following events are dispatched on <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①②">ServiceWorkerContainer</a></code> object:</p>
     <table class="data">
      <thead>
       <tr>
        <th>Event name
        <th>Interface
        <th>Dispatched when…
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="event" data-export id="service-worker-container-controllerchange-event"><code>controllerchange</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#event" id="ref-for-event③">Event</a></code>
        <td>The <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client⑤">service worker client</a>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker②">active worker</a> changes. (See step 9.2 of the <a href="#activation-algorithm">Activate</a> algorithm. The <a href="#dfn-skip-waiting-flag" id="ref-for-dfn-skip-waiting-flag">skip waiting flag</a> of a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤①">service worker</a> causes <a href="#activation-algorithm">activation</a> of the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⓪">service worker registration</a> to occur while <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②①">service worker clients</a> are <a href="#dfn-use" id="ref-for-dfn-use①">using</a> the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④①">service worker registration</a>, <code class="idl"><a data-link-type="idl" href="#service-worker-container-controller-attribute" id="ref-for-service-worker-container-controller-attribute③">navigator.serviceWorker.controller</a></code> immediately reflects the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⑥">active worker</a> as the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤②">service worker</a> that <a href="#dfn-control" id="ref-for-dfn-control③">controls</a> the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②②">service worker client</a>.)
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerContainer" data-dfn-type="event" data-export id="service-worker-container-message-event"><code>message</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-interface" id="ref-for-serviceworkermessage-event-interface②">ServiceWorkerMessageEvent</a></code>
        <td>When it receives a message.
     </table>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="4" id="execution-context"><span class="secno">4. </span><span class="content">Execution Context</span><a class="self-link" href="#execution-context"></a></h2>
    <div class="example" id="example-8e574a30">
     <a class="self-link" href="#example-8e574a30"></a> Serving Cached Resources: 
<pre class="lang-js highlight"><c- c1>// caching.js</c->
<c- k>this</c-><c- p>.</c->addEventListener<c- p>(</c-><c- u>"install"</c-><c- p>,</c-> <c- a>function</c-><c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  e<c- p>.</c->waitUntil<c- p>(</c->
    <c- c1>// Open a cache of resources.</c->
    caches<c- p>.</c->open<c- p>(</c-><c- u>"shell-v1"</c-><c- p>).</c->then<c- p>(</c-><c- a>function</c-><c- p>(</c->cache<c- p>)</c-> <c- p>{</c->
      <c- c1>// Begins the process of fetching them.</c->
      <c- c1>// The coast is only clear when all the resources are ready.</c->
      <c- k>return</c-> cache<c- p>.</c->addAll<c- p>([</c->
        <c- u>"/app.html"</c-><c- p>,</c->
        <c- u>"/assets/v1/base.css"</c-><c- p>,</c->
        <c- u>"/assets/v1/app.js"</c-><c- p>,</c->
        <c- u>"/assets/v1/logo.png"</c-><c- p>,</c->
        <c- u>"/assets/v1/intro_video.webm"</c->
      <c- p>]);</c->
    <c- p>})</c->
  <c- p>);</c->
<c- p>});</c->

<c- k>this</c-><c- p>.</c->addEventListener<c- p>(</c-><c- u>"fetch"</c-><c- p>,</c-> <c- a>function</c-><c- p>(</c->e<c- p>)</c-> <c- p>{</c->
  <c- c1>// No "fetch" events are dispatched to the service worker until it</c->
  <c- c1>// successfully installs and activates.</c->

  <c- c1>// All operations on caches are async, including matching URLs, so we use</c->
  <c- c1>// promises heavily. e.respondWith() even takes promises to enable this:</c->
  e<c- p>.</c->respondWith<c- p>(</c->
    caches<c- p>.</c->match<c- p>(</c->e<c- p>.</c->request<c- p>).</c->then<c- p>(</c-><c- a>function</c-><c- p>(</c->response<c- p>)</c-> <c- p>{</c->
      <c- k>return</c-> response <c- o>||</c-> fetch<c- p>(</c->e<c- p>.</c->request<c- p>);</c->
    <c- p>}).</c-><c- k>catch</c-><c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
      <c- k>return</c-> caches<c- p>.</c->match<c- p>(</c-><c- u>"/fallback.html"</c-><c- p>);</c->
    <c- p>})</c->
  <c- p>);</c->
<c- p>});</c->
</pre>
    </div>
    <section>
     <h3 class="heading settled" data-level="4.1" id="service-worker-global-scope"><span class="secno">4.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface③">ServiceWorkerGlobalScope</a></code></span><a class="self-link" href="#service-worker-global-scope"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Global" id="ref-for-Global"><c- g>Global</c-></a>=(<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#worker" id="ref-for-worker"><c- n>Worker</c-></a>,<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②②"><c- n>ServiceWorker</c-></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface④"><c- g>ServiceWorkerGlobalScope</c-></a> : <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope" id="ref-for-workerglobalscope"><c- n>WorkerGlobalScope</c-></a> {
  // A container for a list of Client objects that correspond to
  // browsing contexts (or shared workers) that are on the origin of this SW
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject④"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#clients-interface" id="ref-for-clients-interface"><c- n>Clients</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Clients" href="#service-worker-global-scope-clients-attribute" id="ref-for-service-worker-global-scope-clients-attribute"><c- g>clients</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑤"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①①"><c- n>ServiceWorkerRegistration</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerRegistration" href="#service-worker-global-scope-scope-attribute" id="ref-for-service-worker-global-scope-scope-attribute"><c- g>registration</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑤"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#service-worker-global-scope-skipwaiting-method" id="ref-for-service-worker-global-scope-skipwaiting-method"><c- g>skipWaiting</c-></a>();

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-oninstall-attribute" id="ref-for-service-worker-global-scope-oninstall-attribute"><c- g>oninstall</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onactivate-attribute" id="ref-for-service-worker-global-scope-onactivate-attribute"><c- g>onactivate</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onfetch-attribute" id="ref-for-service-worker-global-scope-onfetch-attribute"><c- g>onfetch</c-></a>;

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑦"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onmessage-attribute" id="ref-for-service-worker-global-scope-onmessage-attribute"><c- g>onmessage</c-></a>; // event.source of the message events is Client object
};
</pre>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="interface" data-export id="service-worker-global-scope-interface"><code>ServiceWorkerGlobalScope</code></dfn></code> object represents the global execution context of a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤③">service worker</a>. A <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface⑤">ServiceWorkerGlobalScope</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="dfn" data-noexport id="dfn-service-worker-global-scope-service-worker">service worker</dfn> (a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤④">service worker</a>).</p>
     <p class="note" role="note"><code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface⑥">ServiceWorkerGlobalScope</a></code> object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully <a href="#navigator-service-worker-register">registered</a>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⑤">service worker</a> is started, kept alive and killed by their relationship to events, not <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②③">service worker clients</a>. Any type of synchronous requests must not be initiated inside of a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⑥">service worker</a>.</p>
     <section>
      <h4 class="heading settled" data-level="4.1.1" id="service-worker-global-scope-clients"><span class="secno">4.1.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-clients-attribute" id="ref-for-service-worker-global-scope-clients-attribute①">clients</a></code></span><a class="self-link" href="#service-worker-global-scope-clients"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-clients-attribute"><code>clients</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <code class="idl"><a data-link-type="idl" href="#clients-interface" id="ref-for-clients-interface①">Clients</a></code> object that is associated with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⓪">context object</a>.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.1.2" id="service-worker-global-scope-registration"><span class="secno">4.1.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-scope-attribute" id="ref-for-service-worker-global-scope-scope-attribute①">registration</a></code></span><a class="self-link" href="#service-worker-global-scope-registration"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-scope-attribute"><code>registration</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①②">ServiceWorkerRegistration</a></code> object that represents the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker②">service worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration③">containing service worker registration</a>.</p>
     </section>
     <section class="algorithm" data-algorithm="service-worker-global-scope-skipwaiting">
      <h4 class="heading settled" data-level="4.1.3" id="service-worker-global-scope-skipwaiting"><span class="secno">4.1.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-skipwaiting-method" id="ref-for-service-worker-global-scope-skipwaiting-method①">skipWaiting()</a></code></span><a class="self-link" href="#service-worker-global-scope-skipwaiting"></a></h4>
      <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-skipwaiting-method" id="ref-for-service-worker-global-scope-skipwaiting-method②">skipWaiting()</a></code> method allows this <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⑦">service worker</a> to progress from the <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration④">registration</a>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker⑥">waiting</a> position to <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⑦">active</a> even while <a href="#service-worker-client-concept">service worker clients</a> are <a href="#dfn-use" id="ref-for-dfn-use②">using</a> the <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration⑤">registration</a>.</p>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="method" data-export id="service-worker-global-scope-skipwaiting-method"><code>skipWaiting()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⓪">promise</a>.
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③">in parallel</a>: 
        <ol>
         <li>Set <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⑧">service worker</a>’s <a href="#dfn-skip-waiting-flag" id="ref-for-dfn-skip-waiting-flag①">skip waiting flag</a>
         <li>
          If <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑤⑨">service worker</a>’s <a href="#dfn-state" id="ref-for-dfn-state⑤">state</a> is <em>installed</em>, then: 
          <ol>
           <li>Run <a href="#activation-algorithm">Activate</a> algorithm passing <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⓪">service worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration⑥">registration</a> as the argument.
          </ol>
         <li>Resolve <var>promise</var> with undefined.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.1.4" id="service-worker-global-scope-event-handlers"><span class="secno">4.1.4. </span><span class="content">Event handlers</span><a class="self-link" href="#service-worker-global-scope-event-handlers"></a></h4>
      <p>The following are the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers⑥">event handlers</a> (and their corresponding <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type⑥">event handler event types</a>) that <em class="rfc2119" title="MUST">must</em> be supported, as <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes" id="ref-for-event-handler-idl-attributes③">event handler IDL attributes</a>, by all objects implementing the <a href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①③">ServiceWorkerGlobalScope</a> interface:</p>
      <table class="data">
       <thead>
        <tr>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers⑦">event handler</a>
         <th><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type" id="ref-for-event-handler-event-type⑦">event handler event type</a>
       <tbody>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-oninstall-attribute"><code>oninstall</code></dfn>
         <td><code><a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event①">install</a></code>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-onactivate-attribute"><code>onactivate</code></dfn>
         <td><code><a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event①">activate</a></code>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-onfetch-attribute"><code>onfetch</code></dfn>
         <td><code><a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event②">fetch</a></code>
        <tr>
         <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="attribute" data-export id="service-worker-global-scope-onmessage-attribute"><code>onmessage</code></dfn>
         <td><code><a href="#service-worker-global-scope-message-event" id="ref-for-service-worker-global-scope-message-event①">message</a></code>
      </table>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.2" id="client"><span class="secno">4.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-interface" id="ref-for-client-interface①">Client</a></code></span><a class="self-link" href="#client"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#client-interface" id="ref-for-client-interface②"><c- g>Client</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#client-url-attribute" id="ref-for-client-url-attribute"><c- g>url</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#contextframetype-enum" id="ref-for-contextframetype-enum"><c- n>FrameType</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrameType" href="#client-frametype-attribute" id="ref-for-client-frametype-attribute"><c- g>frameType</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#client-id-attribute" id="ref-for-client-id-attribute"><c- g>id</c-></a>;
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#client-postmessage-method" id="ref-for-client-postmessage-method"><c- g>postMessage</c-></a>(<c- b>any</c-> <dfn class="idl-code" data-dfn-for="Client/postMessage(message, transfer), Client/postMessage(message)" data-dfn-type="argument" data-export id="dom-client-postmessage-message-transfer-message"><code><c- g>message</c-></code><a class="self-link" href="#dom-client-postmessage-message-transfer-message"></a></dfn>, <c- b>optional</c-> <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①"><c- b>object</c-></a>> <dfn class="idl-code" data-dfn-for="Client/postMessage(message, transfer), Client/postMessage(message)" data-dfn-type="argument" data-export id="dom-client-postmessage-message-transfer-transfer"><code><c- g>transfer</c-></code><a class="self-link" href="#dom-client-postmessage-message-transfer-transfer"></a></dfn>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑥"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#window-client-interface" id="ref-for-window-client-interface①"><c- g>WindowClient</c-></a> : <a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface③"><c- n>Client</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/page-visibility/#VisibilityState" id="ref-for-VisibilityState"><c- n>VisibilityState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="VisibilityState" href="#client-visibilitystate-attribute" id="ref-for-client-visibilitystate-attribute"><c- g>visibilityState</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#client-focused-attribute" id="ref-for-client-focused-attribute"><c- g>focused</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑥"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface②"><c- n>WindowClient</c-></a>> <a class="idl-code" data-link-type="method" href="#client-focus-method" id="ref-for-client-focus-method"><c- g>focus</c-></a>();
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑦"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface③"><c- n>WindowClient</c-></a>> <dfn class="dfn-paneled idl-code" data-dfn-for="WindowClient" data-dfn-type="method" data-export data-lt="navigate(url)" id="dom-windowclient-navigate"><code><c- g>navigate</c-></code></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="WindowClient/navigate(url)" data-dfn-type="argument" data-export id="dom-windowclient-navigate-url-url"><code><c- g>url</c-></code><a class="self-link" href="#dom-windowclient-navigate-url-url"></a></dfn>);
};

<c- b>enum</c-> <a class="idl-code" data-link-type="enum" href="#contextframetype-enum" id="ref-for-contextframetype-enum①"><c- g>FrameType</c-></a> {
  <dfn class="idl-code" data-dfn-for="FrameType" data-dfn-type="enum-value" data-export id="dom-frametype-auxiliary"><code><c- s>"auxiliary"</c-></code><a class="self-link" href="#dom-frametype-auxiliary"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="FrameType" data-dfn-type="enum-value" data-export id="dom-frametype-top-level"><code><c- s>"top-level"</c-></code><a class="self-link" href="#dom-frametype-top-level"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="FrameType" data-dfn-type="enum-value" data-export id="dom-frametype-nested"><code><c- s>"nested"</c-></code><a class="self-link" href="#dom-frametype-nested"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="FrameType" data-dfn-type="enum-value" data-export id="dom-frametype-none"><code><c- s>"none"</c-></code><a class="self-link" href="#dom-frametype-none"></a></dfn>
};
</pre>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="client-interface"><code>Client</code></dfn></code> object has an associated <dfn class="dfn-paneled" data-dfn-for="Client" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-client">service worker client</dfn> (a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②④">service worker client</a>).</p>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="window-client-interface"><code>WindowClient</code></dfn></code> object has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-visibilitystate">visibility state</dfn>, which is one of <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate">visibilityState</a></code> attribute value.</p>
     <p>A <code class="idl"><a data-link-type="idl" href="#window-client-interface" id="ref-for-window-client-interface④">WindowClient</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-service-worker-client-focusstate">focus state</dfn>, which is either true or false (initially false).</p>
     <section>
      <h4 class="heading settled" data-level="4.2.1" id="client-url"><span class="secno">4.2.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-url-attribute" id="ref-for-client-url-attribute①">url</a></code></span><a class="self-link" href="#client-url"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Client" data-dfn-type="attribute" data-export id="client-url-attribute"><code>url</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②①">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client">service worker client</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer②">serialized</a> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url②">creation url</a>.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.2.2" id="client-frametype"><span class="secno">4.2.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-frametype-attribute" id="ref-for-client-frametype-attribute①">frameType</a></code></span><a class="self-link" href="#client-frametype"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Client" data-dfn-type="attribute" data-export id="client-frametype-attribute"><code>frameType</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value (in <dfn class="dfn-paneled idl-code" data-dfn-type="enum" data-export id="contextframetype-enum"><code>FrameType</code></dfn> enumeration) corresponding to the first matching statement, switching on <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client①">service worker client</a>’s <a href="#dfn-service-worker-client-frame-type" id="ref-for-dfn-service-worker-client-frame-type">frame type</a>:</p>
      <dl>
       <dt><em>auxiliary</em>
       <dd>
        "<code>auxiliary</code>" 
        <p class="note" role="note">The <a href="#dfn-window-client" id="ref-for-dfn-window-client">window client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global⑥">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context①">browsing context</a> is an <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context" id="ref-for-auxiliary-browsing-context">auxiliary browsing context</a>.</p>
       <dt><em>top-level</em>
       <dd>
        "<code>top-level</code>" 
        <p class="note" role="note">The <a href="#dfn-window-client" id="ref-for-dfn-window-client①">window client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global⑦">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context②">browsing context</a> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context" id="ref-for-top-level-browsing-context">top-level browsing context</a>.</p>
       <dt><em>nested</em>
       <dd>
        "<code>nested</code>" 
        <p class="note" role="note">The <a href="#dfn-window-client" id="ref-for-dfn-window-client②">window client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global⑧">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context③">browsing context</a> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context" id="ref-for-nested-browsing-context①">nested browsing context</a>.</p>
       <dt><em>none</em>
       <dd>"<code>none</code>"
      </dl>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.2.3" id="client-id"><span class="secno">4.2.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-id-attribute" id="ref-for-client-id-attribute①">id</a></code></span><a class="self-link" href="#client-id"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Client" data-dfn-type="attribute" data-export id="client-id-attribute"><code>id</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return its associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client②">service worker client</a>’s <a href="#dfn-service-worker-client-id" id="ref-for-dfn-service-worker-client-id">id</a>.</p>
     </section>
     <section class="algorithm" data-algorithm="client-postmessage">
      <h4 class="heading settled" data-level="4.2.4" id="client-postmessage"><span class="secno">4.2.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-postmessage-method" id="ref-for-client-postmessage-method①">postMessage(message, transfer)</a></code></span><a class="self-link" href="#client-postmessage"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Client" data-dfn-type="method" data-export data-lt="postMessage(message, transfer)|postMessage(message)" id="client-postmessage-method"><code>postMessage(<var>message</var>, <var>transfer</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>sourceSettings</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②②">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑦">relevant settings object</a>.
       <li>Let <var>destination</var> be the <code class="idl"><a data-link-type="idl" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①③">ServiceWorkerContainer</a></code> object whose <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client⑥">service worker client</a> is the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②③">context object</a>’s <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client③">service worker client</a>.
       <li>If <var>destination</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw③">throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror③">InvalidStateError</a></code>" exception.
       <li>Let <var>targetRealm</var> be <var>destination</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm">relevant Realm</a>.
       <li>Let <var>cloneRecord</var> be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclonewithtransfer" id="ref-for-structuredclonewithtransfer①">StructuredCloneWithTransfer</a>(<var>message</var>, <var>transfer</var>, <var>targetRealm</var>). If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw④">throws</a> an exception, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw⑤">rethrow</a> that exception and abort these steps.
       <li>Let <var>clonedMessage</var> be <var>cloneRecord</var>.[[Clone]].
       <li>Let <var>newPorts</var> be a new <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-frozen-array-type" id="ref-for-dfn-frozen-array-type①">frozen array</a> consisting of all <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑥">MessagePort</a></code> objects in <var>cloneRecord</var>.[[TransferList]], if any, maintaining their relative order.
       <li>
        Add a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task④">task</a> that runs the following steps to <var>destination</var>’s <a data-link-type="dfn" href="#dfn-client-message-queue" id="ref-for-dfn-client-message-queue⑤">client message queue</a>: 
        <ol>
         <li>Create an event <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-interface" id="ref-for-serviceworkermessage-event-interface③">ServiceWorkerMessageEvent</a></code> interface, with the event type <a href="#service-worker-container-message-event" id="ref-for-service-worker-container-message-event③">message</a>, which does not bubble and is not cancelable.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-data-attribute" id="ref-for-serviceworkermessage-event-data-attribute②">data</a></code> attribute of <var>e</var> be initialized to <var>clonedMessage</var>.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-origin-attribute" id="ref-for-serviceworkermessage-event-origin-attribute②">origin</a></code> attribute of <var>e</var> be initialized to the <a data-link-type="dfn">Unicode serialization</a> of <var>sourceSettings</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2⑦">origin</a>.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-source-attribute" id="ref-for-serviceworkermessage-event-source-attribute②">source</a></code> attribute of <var>e</var> be initialized to a <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②③">ServiceWorker</a></code> object, which represents the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker③">service worker</a> associated with <var>sourceSettings</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global⑨">global object</a>.
         <li>Let the <code class="idl"><a data-link-type="idl" href="#serviceworkermessage-event-ports-attribute" id="ref-for-serviceworkermessage-event-ports-attribute②">ports</a></code> attribute of <var>e</var> be initialized to <var>newPorts</var>.
         <li><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch③">Dispatch</a> <var>e</var> at <var>destination</var>.
        </ol>
      </ol>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.2.5" id="client-visibilitystate"><span class="secno">4.2.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-visibilitystate-attribute" id="ref-for-client-visibilitystate-attribute①">visibilityState</a></code></span><a class="self-link" href="#client-visibilitystate"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="WindowClient" data-dfn-type="attribute" data-export id="client-visibilitystate-attribute"><code>visibilityState</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②④">context object</a>’s <a href="#dfn-service-worker-client-visibilitystate" id="ref-for-dfn-service-worker-client-visibilitystate">visibility state</a>.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.2.6" id="client-focused"><span class="secno">4.2.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-focused-attribute" id="ref-for-client-focused-attribute①">focused</a></code></span><a class="self-link" href="#client-focused"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="WindowClient" data-dfn-type="attribute" data-export id="client-focused-attribute"><code>focused</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑤">context object</a>’s <a href="#dfn-service-worker-client-focusstate" id="ref-for-dfn-service-worker-client-focusstate">focus state</a>.</p>
     </section>
     <section class="algorithm" data-algorithm="client-focus">
      <h4 class="heading settled" data-level="4.2.7" id="client-focus"><span class="secno">4.2.7. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#client-focus-method" id="ref-for-client-focus-method①">focus()</a></code></span><a class="self-link" href="#client-focus"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="WindowClient" data-dfn-type="method" data-export id="client-focus-method"><code>focus()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>If this algorithm is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation" id="ref-for-triggered-by-user-activation">triggered by user activation</a>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①①">promise</a> rejected with an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidaccesserror" id="ref-for-invalidaccesserror">InvalidAccessError</a></code>" exception.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①②">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel④">in parallel</a>: 
        <ol>
         <li>Let <var>browsingContext</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑥">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client④">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⓪">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context④">browsing context</a>.
         <li>Let <var>visibilityState</var> be null.
         <li>Let <var>focusState</var> be null.
         <li>
          <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task③">Queue a task</a> <var>task</var> to run the following substeps on the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑦">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client⑤">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source" id="ref-for-user-interaction-task-source">user interaction task source</a>: 
          <ol>
           <li>Run the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps" id="ref-for-focusing-steps">focusing steps</a> with <var>browsingContext</var>.
           <li>Set <var>visibilityState</var> to <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate①">visibilityState</a></code> attribute value.
           <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①">active document</a> as the argument.
          </ol>
         <li>Wait for <var>task</var> to have executed.
         <li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑧">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client⑥">service worker client</a>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
         <li>If <var>windowClient</var>’s <a href="#dfn-service-worker-client-focusstate" id="ref-for-dfn-service-worker-client-focusstate①">focus state</a> is true, resolve <var>promise</var> with <var>windowClient</var>.
         <li>Else, reject <var>promise</var> with a <code>TypeError</code>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="client-navigate">
      <h4 class="heading settled" data-level="4.2.8" id="client-navigate"><span class="secno">4.2.8. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#dom-windowclient-navigate" id="ref-for-dom-windowclient-navigate">navigate(url)</a></code></span><a class="self-link" href="#client-navigate"></a></h4>
      <p>The <dfn class="idl-code" data-dfn-for="WindowClient" data-dfn-type="method" data-export id="client-navigate-method"><code>navigate()</code><a class="self-link" href="#client-navigate-method"></a></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>url</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser⑤">parsing</a> <var>url</var> with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object②⑨">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑧">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url③">API base URL</a>.
       <li>If <var>url</var> is failure, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①③">promise</a> rejected with a <code>TypeError</code>.
       <li>If <var>url</var> is <code><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#about:blank" id="ref-for-about:blank">about:blank</a></code>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①④">promise</a> rejected with a <code>TypeError</code>.
       <li>If the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③⓪">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client⑦">service worker client</a>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker③">active worker</a> is not the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③①">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global" id="ref-for-concept-relevant-global①">relevant global object</a>’s <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker④">service worker</a>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⑤">promise</a> rejected with a <code>TypeError</code>.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⑥">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑤">in parallel</a>: 
        <ol>
         <li>Let <var>browsingContext</var> be the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③②">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client⑧">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①①">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑤">browsing context</a>.
         <li>If <var>browsingContext</var> has <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document" id="ref-for-discard-a-document">discarded</a> its <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#document" id="ref-for-document">Document</a></code>, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.
         <li>Let <var>navigateFailed</var> to false.
         <li>Let <var>visibilityState</var> be null.
         <li>Let <var>focusState</var> be null.
         <li>
          <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task④">Queue a task</a> <var>task</var> to run the following substeps on the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③③">context object</a>’s associated <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client⑨">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source" id="ref-for-user-interaction-task-source①">user interaction task source</a>: 
          <ol>
           <li><em>HandleNavigate</em>: <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate①">Navigate</a> <var>browsingContext</var> to <var>url</var> with <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#replacement-enabled" id="ref-for-replacement-enabled">replacement enabled</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#exceptions-enabled" id="ref-for-exceptions-enabled">exceptions enabled</a>. The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#source-browsing-context" id="ref-for-source-browsing-context">source browsing context</a> must be <var>browsingContext</var>.
           <li>If the algorithm steps invoked in the step labeled <em>HandleNavigate</em> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw⑥">throws</a> an exception, set <var>navigateFailed</var> to true.
           <li>Set <var>visibilityState</var> to <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document②">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate②">visibilityState</a></code> attribute value.
           <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps①">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document③">active document</a> as the argument.
          </ol>
         <li>Wait for <var>task</var> to have executed (including its asynchronous steps).
         <li>If <var>navigateFailed</var> is true, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.
         <li>
          If <var>browsingContext</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window③">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object③">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url③">creation url</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2⑧">origin</a> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin①">same</a> as the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker⑤">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2⑨">origin</a>, then: 
          <ol>
           <li>Resolve <var>promise</var> with null.
           <li>Abort these steps.
          </ol>
         <li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>browsingContext</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window④">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object④">environment settings object</a>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
         <li>Resolve <var>promise</var> with <var>windowClient</var>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.3" id="clients"><span class="secno">4.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#clients-interface" id="ref-for-clients-interface②">Clients</a></code></span><a class="self-link" href="#clients"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑦"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#clients-interface" id="ref-for-clients-interface③"><c- g>Clients</c-></a> {
  // The objects returned will be new instances every time
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑧"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#clients-get-method" id="ref-for-clients-get-method"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="Clients/get(id)" data-dfn-type="argument" data-export id="dom-clients-get-id-id"><code><c- g>id</c-></code><a class="self-link" href="#dom-clients-get-id-id"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑨"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface④"><c- n>Client</c-></a>>> <a class="idl-code" data-link-type="method" href="#clients-matchall-method" id="ref-for-clients-matchall-method"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-clients-clientqueryoptions" id="ref-for-dictdef-clients-clientqueryoptions"><c- n>ClientQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="Clients/matchAll(options), Clients/matchAll()" data-dfn-type="argument" data-export id="dom-clients-matchall-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-clients-matchall-options-options"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⓪"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface⑤"><c- n>WindowClient</c-></a>?> <a class="idl-code" data-link-type="method" href="#clients-openwindow-method" id="ref-for-clients-openwindow-method"><c- g>openWindow</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦"><c- b>USVString</c-></a> <dfn class="idl-code" data-dfn-for="Clients/openWindow(url)" data-dfn-type="argument" data-export id="dom-clients-openwindow-url-url"><code><c- g>url</c-></code><a class="self-link" href="#dom-clients-openwindow-url-url"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#clients-claim-method" id="ref-for-clients-claim-method"><c- g>claim</c-></a>();
};
</pre>
<pre class="idl highlight def" id="serviceworker-client-query-options-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="dictionary" data-export id="dictdef-clients-clientqueryoptions"><code><c- g>ClientQueryOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="ClientQueryOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-clientqueryoptions-includeuncontrolled"><code><c- g>includeUncontrolled</c-></code></dfn> = <c- b>false</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-clients-clienttype" id="ref-for-enumdef-clients-clienttype"><c- n>ClientType</c-></a> <dfn class="dfn-paneled idl-code" data-default="&quot;window&quot;" data-dfn-for="ClientQueryOptions" data-dfn-type="dict-member" data-export data-type="ClientType " id="dom-clientqueryoptions-type"><code><c- g>type</c-></code></dfn> = "window";
};
</pre>
<pre class="idl highlight def" id="client-type-enum"><c- b>enum</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="enum" data-export id="enumdef-clients-clienttype"><code><c- g>ClientType</c-></code></dfn> {
  <dfn class="idl-code" data-dfn-for="ClientType" data-dfn-type="enum-value" data-export id="dom-clienttype-window"><code><c- s>"window"</c-></code><a class="self-link" href="#dom-clienttype-window"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ClientType" data-dfn-type="enum-value" data-export id="dom-clienttype-worker"><code><c- s>"worker"</c-></code><a class="self-link" href="#dom-clienttype-worker"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ClientType" data-dfn-type="enum-value" data-export id="dom-clienttype-sharedworker"><code><c- s>"sharedworker"</c-></code><a class="self-link" href="#dom-clienttype-sharedworker"></a></dfn>,
  <dfn class="idl-code" data-dfn-for="ClientType" data-dfn-type="enum-value" data-export id="dom-clienttype-all"><code><c- s>"all"</c-></code><a class="self-link" href="#dom-clienttype-all"></a></dfn>
};
</pre>
     <p>The user agent <em class="rfc2119" title="MUST">must</em> create a <code><dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="interface" data-export id="clients-interface"><code>Clients</code></dfn></code> object when a <code><a href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①④">ServiceWorkerGlobalScope</a></code> object is created and associate it with that object.</p>
     <section class="algorithm" data-algorithm="clients-get">
      <h4 class="heading settled" data-level="4.3.1" id="clients-get"><span class="secno">4.3.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#clients-get-method" id="ref-for-clients-get-method①">get(id)</a></code></span><a class="self-link" href="#clients-get"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="method" data-export id="clients-get-method"><code>get(<var>id</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⑦">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑥">in parallel</a>: 
        <ol>
         <li>
          For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⑤">service worker client</a> <var>client</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⓪">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin②">same</a> as the associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker⑥">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①①">origin</a>: 
          <ol>
           <li>
            If <var>client</var>’s <a href="#dfn-service-worker-client-id" id="ref-for-dfn-service-worker-client-id①">id</a> is <var>id</var>, then: 
            <ol>
             <li>If <var>client</var> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context">secure context</a>, reject <var>promise</var> with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror①">SecurityError</a></code>" exception and abort these steps.
             <li>
              If <var>client</var> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client③">window client</a>, then: 
              <ol>
               <li>Let <var>browsingContext</var> be <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①②">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑥">browsing context</a>.
               <li>Let <var>visibilityState</var> be null.
               <li>Let <var>focusState</var> be null.
               <li>
                <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑤">Queue a task</a> <var>task</var> to run the following substeps: 
                <ol>
                 <li>Set <var>visibilityState</var> to <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document④">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate③">visibilityState</a></code> attribute value.
                 <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps②">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑤">active document</a> as the argument.
                </ol>
               <li>Wait for <var>task</var> to have executed.
               <li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
               <li>Resolve <var>promise</var> with <var>windowClient</var> and abort these steps.
              </ol>
             <li>
              Else: 
              <ol>
               <li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.
               <li>Resolve <var>promise</var> with <var>clientObject</var> and abort these steps.
              </ol>
            </ol>
          </ol>
         <li>Resolve <var>promise</var> with undefined.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="clients-getall">
      <h4 class="heading settled" data-level="4.3.2" id="clients-getall"><span class="secno">4.3.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#clients-matchall-method" id="ref-for-clients-matchall-method①">matchAll(options)</a></code></span><a class="self-link" href="#clients-getall"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="method" data-export data-lt="matchAll(options)|matchAll()" id="clients-matchall-method"><code>matchAll(<var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⑧">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑦">in parallel</a>: 
        <ol>
         <li>Let <var>targetClients</var> be an empty array.
         <li>
          For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⑥">service worker client</a> <var>client</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①②">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin③">same</a> as the associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker⑦">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①③">origin</a>: 
          <ol>
           <li>If <var>client</var> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context①">secure context</a>, continue to the next iteration of the loop.
           <li>
            If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-clientqueryoptions-includeuncontrolled" id="ref-for-dom-clientqueryoptions-includeuncontrolled">includeUncontrolled</a></code> is false, then: 
            <ol>
             <li>If <var>client</var>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker④">active worker</a> is the associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker⑧">service worker</a>, add <var>client</var> to <var>targetClients</var>.
            </ol>
           <li>
            Else: 
            <ol>
             <li>Add <var>client</var> to <var>targetClients</var>.
            </ol>
          </ol>
         <li>Let <var>matchedClients</var> be an empty array.
         <li>
          For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⑦">service worker client</a> <var>client</var> in <var>targetClients</var>, in the most recently <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps" id="ref-for-focusing-steps①">focused</a> order for <a href="#dfn-window-client" id="ref-for-dfn-window-client④">window clients</a>: 
          <ol>
           <li>
            If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-clientqueryoptions-type" id="ref-for-dom-clientqueryoptions-type">type</a></code> is "<code>window</code>", and <var>client</var> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client⑤">window client</a>, then: 
            <ol>
             <li>Let <var>browsingContext</var> be <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①③">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑦">browsing context</a>.
             <li>Let <var>isClientEnumerable</var> be false.
             <li>Let <var>visibilityState</var> be the empty string.
             <li>Let <var>focusState</var> be false.
             <li>
              <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑥">Queue a task</a> <var>task</var> to run the following substep on <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop②">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source" id="ref-for-user-interaction-task-source②">user interaction task source</a>: 
              <ol>
               <li>
                If <var>browsingContext</var> has not been <a data-link-type="dfn">discarded</a> and <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document" id="ref-for-responsible-document①">responsible document</a> is <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑥">active document</a>, then: 
                <ol>
                 <li>Set <var>visibilityState</var> to <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑦">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate④">visibilityState</a></code> attribute value.
                 <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps③">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑧">active document</a> as the argument.
                 <li>Set <var>isClientEnumerable</var> to true.
                </ol>
              </ol>
             <li>
              Wait for <var>task</var> to have executed. 
              <p class="note" role="note">Wait is a blocking wait, but implementers may run the iterations in parallel as long as the state is not broken.</p>
             <li>
              If <var>isClientEnumerable</var> is true, then: 
              <ol>
               <li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
               <li>Add <var>windowClient</var> to <var>matchedClients</var>.
              </ol>
            </ol>
           <li>
            Else if <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-clientqueryoptions-type" id="ref-for-dom-clientqueryoptions-type①">type</a></code> is "<code>worker</code>" and <var>client</var> is a <a href="#dfn-dedicatedworker-client" id="ref-for-dfn-dedicatedworker-client①">dedicated worker client</a>, or <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-clientqueryoptions-type" id="ref-for-dom-clientqueryoptions-type②">type</a></code> is "<code>sharedworker</code>" and <var>client</var> is a <a href="#dfn-sharedworker-client" id="ref-for-dfn-sharedworker-client①">shared worker client</a>, then: 
            <ol>
             <li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.
             <li>Add <var>clientObject</var> to <var>matchedClients</var>.
            </ol>
           <li>
            Else if <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-clientqueryoptions-type" id="ref-for-dom-clientqueryoptions-type③">type</a></code> is "<code>all</code>", then: 
            <ol>
             <li>
              If <var>client</var> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client⑥">window client</a>, then: 
              <ol>
               <li>Let <var>browsingContext</var> be <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①④">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context" id="ref-for-browsing-context⑧">browsing context</a>.
               <li>Let <var>isClientEnumerable</var> be false.
               <li>Let <var>visibilityState</var> be the empty string.
               <li>Let <var>focusState</var> be false.
               <li>
                <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑦">Queue a task</a> <var>task</var> to run the following substep on <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop③">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source" id="ref-for-user-interaction-task-source③">user interaction task source</a>: 
                <ol>
                 <li>
                  If <var>browsingContext</var> has not been <a data-link-type="dfn">discarded</a> and <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document" id="ref-for-responsible-document②">responsible document</a> is <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document⑨">active document</a>, then: 
                  <ol>
                   <li>Set <var>visibilityState</var> to <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①⓪">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate⑤">visibilityState</a></code> attribute value.
                   <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps④">has focus steps</a> with <var>browsingContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①①">active document</a> as the argument.
                   <li>Set <var>isClientEnumerable</var> to true.
                  </ol>
                </ol>
               <li>
                Wait for <var>task</var> to have executed. 
                <p class="note" role="note">Wait is a blocking wait, but implementers may run the iterations in parallel as long as the state is not broken.</p>
               <li>
                If <var>isClientEnumerable</var> is true, then: 
                <ol>
                 <li>Let <var>windowClient</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>client</var>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
                 <li>Add <var>windowClient</var> to <var>matchedClients</var>.
                </ol>
              </ol>
             <li>
              Else: 
              <ol>
               <li>Let <var>clientObject</var> be the result of running <a href="#create-client-algorithm">Create Client</a> algorithm with <var>client</var> as the argument.
               <li>Add <var>clientObject</var> to <var>matchedClients</var>.
              </ol>
            </ol>
          </ol>
         <li>Resolve <var>promise</var> with <var>matchedClients</var>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="clients-openwindow">
      <h4 class="heading settled" data-level="4.3.3" id="clients-openwindow"><span class="secno">4.3.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#clients-openwindow-method" id="ref-for-clients-openwindow-method①">openWindow(url)</a></code></span><a class="self-link" href="#clients-openwindow"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="method" data-export id="clients-openwindow-method"><code>openWindow(<var>url</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>url</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser⑥">parsing</a> <var>url</var> with the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③④">context object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object⑨">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url④">API base URL</a>.
       <li>If <var>url</var> is failure, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects①⑨">promise</a> rejected with a <code>TypeError</code>.
       <li>If <var>url</var> is <code><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#about:blank" id="ref-for-about:blank①">about:blank</a></code>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⓪">promise</a> rejected with a <code>TypeError</code>.
       <li>If this algorithm is not <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation" id="ref-for-triggered-by-user-activation①">triggered by user activation</a>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②①">promise</a> rejected with an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidaccesserror" id="ref-for-invalidaccesserror①">InvalidAccessError</a></code>" exception.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②②">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑧">in parallel</a>: 
        <ol>
         <li>Let <var>newContext</var> be a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context" id="ref-for-top-level-browsing-context①">top-level browsing context</a>.
         <li>Let <var>openWindowFailed</var> to false.
         <li>Let <var>visibilityState</var> be null.
         <li>Let <var>focusState</var> be null.
         <li>
          <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑧">Queue a task</a> <var>task</var> to run the following substeps on <var>newContext</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑤">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑤">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop④">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source" id="ref-for-user-interaction-task-source④">user interaction task source</a>: 
          <ol>
           <li><em>HandleNavigate</em>: <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate②">Navigate</a> <var>newContext</var> to <var>url</var>, with <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#exceptions-enabled" id="ref-for-exceptions-enabled①">exceptions enabled</a> and <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#replacement-enabled" id="ref-for-replacement-enabled①">replacement enabled</a>.
           <li>If the algorithm steps invoked in the step labeled <em>HandleNavigate</em> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw⑦">throws</a> an exception, set <var>openWindowFailed</var> to true.
           <li>Set <var>visibilityState</var> to <var>newContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①②">active document</a>’s <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate" id="ref-for-dom-document-visibilitystate⑥">visibilityState</a></code> attribute value.
           <li>Set <var>focusState</var> to the result of running the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps" id="ref-for-has-focus-steps⑤">has focus steps</a> with <var>newContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#active-document" id="ref-for-active-document①③">active document</a> as the argument.
          </ol>
         <li>Wait for <var>task</var> to have executed (including its asynchronous steps).
         <li>If <var>openWindowFailed</var> is true, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.
         <li>
          If <var>newContext</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑥">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑥">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url④">creation url</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①④">origin</a> is not the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin④">same</a> as the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker⑨">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⑤">origin</a>, then: 
          <ol>
           <li>Resolve <var>promise</var> with null.
           <li>Abort these steps.
          </ol>
         <li>Let <var>client</var> be the result of running <a href="#create-windowclient-algorithm">Create Window Client</a> algorithm with <var>newContext</var>’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑦">Window</a></code> object’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑦">environment settings object</a>, <var>visibilityState</var> and <var>focusState</var> as the arguments.
         <li>Resolve <var>promise</var> with <var>client</var>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="clients-claim">
      <h4 class="heading settled" data-level="4.3.4" id="clients-claim"><span class="secno">4.3.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#clients-claim-method" id="ref-for-clients-claim-method①">claim()</a></code></span><a class="self-link" href="#clients-claim"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="Clients" data-dfn-type="method" data-export id="clients-claim-method"><code>claim()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>If the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⓪">service worker</a> is not an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⑧">active worker</a>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②③">promise</a> rejected with an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror④">InvalidStateError</a></code>" exception.
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②④">promise</a>.
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel⑨">in parallel</a>: 
        <ol>
         <li>
          For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⑧">service worker client</a> <var>client</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⑥">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/origin.html#same-origin" id="ref-for-same-origin⑤">same</a> as the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①①">service worker</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⑦">origin</a>: 
          <ol>
           <li>If <var>client</var> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context②">secure context</a>, continue to the next iteration of the loop.
           <li>Let <var>registration</var> be the result of running <a href="#scope-match-algorithm">Match Service Worker Registration</a> algorithm passing <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url⑤">creation url</a> as the argument.
           <li>If <var>registration</var> is not the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①②">service worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration⑦">containing service worker registration</a>, continue to the next iteration of the loop.
           <li>
            If <var>client</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker①⑨">active worker</a> is not the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①③">service worker</a>, then: 
            <ol>
             <li>Invoke <a href="#on-client-unload-algorithm">Handle Service Worker Client Unload</a> with <var>client</var> as the argument.
             <li>Set <var>client</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⓪">active worker</a> to <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①④">service worker</a>.
             <li>Invoke <a href="#notify-controller-change-algorithm">Notify Controller Change</a> algorithm with <var>client</var> as the argument.
            </ol>
          </ol>
         <li>Resolve <var>promise</var> with undefined.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.4" id="extendable-event"><span class="secno">4.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface">ExtendableEvent</a></code></span><a class="self-link" href="#extendable-event"></a></h3>
<pre class="idl highlight def">[<dfn class="idl-code" data-dfn-for="ExtendableEvent" data-dfn-type="constructor" data-export data-lt="ExtendableEvent(type, eventInitDict)|ExtendableEvent(type)" id="dom-extendableevent-extendableevent"><code><c- g>Constructor</c-></code><a class="self-link" href="#dom-extendableevent-extendableevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑦"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableEvent/ExtendableEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-extendableevent-extendableevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-extendableevent-extendableevent-type-eventinitdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit"><c- n>ExtendableEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableEvent/ExtendableEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-extendableevent-extendableevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-extendableevent-extendableevent-type-eventinitdict-eventinitdict"></a></dfn>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑧"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#extendable-event-interface" id="ref-for-extendable-event-interface①"><c- g>ExtendableEvent</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event④"><c- n>Event</c-></a> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method"><c- g>waitUntil</c-></a>(<c- b>Promise</c->&lt;<c- b>any</c->> <dfn class="idl-code" data-dfn-for="ExtendableEvent/waitUntil(f)" data-dfn-type="argument" data-export id="dom-extendableevent-waituntil-f-f"><code><c- g>f</c-></code><a class="self-link" href="#dom-extendableevent-waituntil-f-f"></a></dfn>);
};
</pre>
<pre class="idl highlight def" id="extendable-event-init-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="dictionary" data-export id="dictdef-extendableeventinit"><code><c- g>ExtendableEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①"><c- n>EventInit</c-></a> {
  // Defined for the forward compatibility across the derived events
};
</pre>
     <p>An <code><dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="extendable-event-interface" title="ExtendableEvent"><code>ExtendableEvent</code></dfn></code> object has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-extend-lifetime-promises">extend lifetime promises</dfn> (an array of <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⑤">promises</a>). It is initially an empty array.</p>
     <p>An <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface②">ExtendableEvent</a></code> object has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="extensions-allowed-flag">extensions allowed flag</dfn>. It is initially set.</p>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥①">Service workers</a> have two <a href="#dfn-lifecycle-events" id="ref-for-dfn-lifecycle-events">lifecycle events</a>, <code><a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event②">install</a></code> and <code><a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event②">activate</a></code>. <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥②">Service workers</a> use the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface③">ExtendableEvent</a></code> interface for <code><a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event③">activate</a></code> event and <code><a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event③">install</a></code> event.</p>
     <p><a href="#extensibility">Service worker extensions</a> that <a href="#extension-to-service-worker-global-scope">define event handlers</a> <em class="rfc2119" title="MAY">may</em> also use or extend the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface④">ExtendableEvent</a></code> interface.</p>
     <p>When <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch④">dispatching</a> an event <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑤">ExtendableEvent</a></code> interface, the user agent <em class="rfc2119" title="MUST">must</em> run these steps:</p>
     <ol>
      <li>If <var>e</var>’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises">extend lifetime promises</a> is empty, unset <var>e</var>’s <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag">extensions allowed flag</a> and abort these steps.
      <li>Let <var>extendLifetimePromises</var> be an empty array.
      <li>
       Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⓪">in parallel</a>: 
       <ol>
        <li><em>SetupPromiseArray</em>: Set <var>extendLifetimePromises</var> to a copy of <var>e</var>’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises①">extend lifetime promises</a>.
        <li>Wait until all the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⑥">promises</a> in <var>extendLifetimePromises</var> settle.
        <li>If the length of <var>extendLifetimePromises</var> does not equal the length of <var>e</var>’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises②">extend lifetime promises</a>, jump to the step labeled <em>SetupPromiseArray</em>.
        <li>Unset <var>e</var>’s <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag①">extensions allowed flag</a>.
       </ol>
     </ol>
     <p>The user agent <em class="rfc2119" title="SHOULD NOT">should not</em> <a href="#terminate-service-worker-algorithm">terminate</a> the <a data-link-type="dfn" href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥③">service worker</a> associated with <var>e</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①⓪">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⑤">global object</a> until <var>e</var>’s <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag②">extensions allowed flag</a> is unset. However, the user agent <em class="rfc2119" title="MAY">may</em> impose a time limit to this lifetime extension.</p>
     <section class="algorithm" data-algorithm="wait-until-method">
      <h4 class="heading settled" data-level="4.4.1" id="wait-until-method"><span class="secno">4.4.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method①">event.waitUntil(f)</a></code></span><a class="self-link" href="#wait-until-method"></a></h4>
      <p><code class="idl"><a data-link-type="idl" href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method②">waitUntil(f)</a></code> method extends the lifetime of the event.</p>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableEvent" data-dfn-type="method" data-export id="extendable-event-waituntil-method"><code>waitUntil(<var>f</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>
        If the <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag③">extensions allowed flag</a> is unset, then: 
        <ol>
         <li><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw⑧">Throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑤">InvalidStateError</a></code>" exception.
         <li>Abort these steps.
        </ol>
       <li>Add <var>f</var> to the <a href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises⑨">extend lifetime promises</a>.
      </ol>
     </section>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥④">Service workers</a> and <a href="#extensibility">extensions</a> that <a href="#extension-to-service-worker-global-scope">define event handlers</a> <em class="rfc2119" title="MAY">may</em> define their own behaviors, allowing the <a href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises①⓪">extend lifetime promises</a> to suggest operation length, and the rejected state of any of the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⑦">promise</a> in <a href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises①①">extend lifetime promises</a> to suggest operation failure.</p>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⑤">Service workers</a> define the following behaviors for <code><a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event④">install</a></code> event and <code><a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event④">activate</a></code> event, respectively:</p>
     <ul>
      <li>Adding a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⑧">promise</a> <var>f</var> to the event’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises③">extend lifetime promises</a> delays treating the <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker⑨">installing worker</a> as <em><a href="#dfn-state" id="ref-for-dfn-state⑥">installed</a></em> (i.e. a <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker⑦">waiting worker</a>) until all the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects②⑨">promises</a> in the <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises④">extend lifetime promises</a> resolve successfully. (See step 11.3.1 of <a href="#installation-algorithm">Install</a> algorithm.) If <var>f</var> rejects, the installation fails. This is primarily used to ensure that a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⑥">service worker</a> is not considered <em><a href="#dfn-state" id="ref-for-dfn-state⑦">installed</a></em> (i.e. a <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker⑧">waiting worker</a>) until all of the core caches it depends on are populated.
      <li>Adding a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⓪">promise</a> to the event’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises⑤">extend lifetime promises</a> delays treating the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②①">active worker</a> as <em><a href="#dfn-state" id="ref-for-dfn-state⑧">activated</a></em> until all the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③①">promises</a> in the <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises⑥">extend lifetime promises</a> settle. (See step 12.3 of <a href="#activation-algorithm">Activate</a> algorithm.) This is primarily used to ensure that any <a href="#dfn-functional-events" id="ref-for-dfn-functional-events①">functional events</a> are not dispatched to the <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface⑦">ServiceWorkerGlobalScope</a></code> object that represents the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⑦">service worker</a> until it upgrades database schemas and deletes the outdated cache entries.
     </ul>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.5" id="fetch-event-section"><span class="secno">4.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#fetch-event-interface" id="ref-for-fetch-event-interface">FetchEvent</a></code></span><a class="self-link" href="#fetch-event-section"></a></h3>
<pre class="idl highlight def">[<dfn class="idl-code" data-dfn-for="FetchEvent" data-dfn-type="constructor" data-export data-lt="FetchEvent(type, eventInitDict)" id="dom-fetchevent-fetchevent"><code><c- g>Constructor</c-></code><a class="self-link" href="#dom-fetchevent-fetchevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑧"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="FetchEvent/FetchEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-fetchevent-fetchevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-fetchevent-fetchevent-type-eventinitdict-type"></a></dfn>, <a class="n" data-link-type="idl-name" href="#dictdef-fetchevent-fetcheventinit" id="ref-for-dictdef-fetchevent-fetcheventinit"><c- n>FetchEventInit</c-></a> <dfn class="idl-code" data-dfn-for="FetchEvent/FetchEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-fetchevent-fetchevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-fetchevent-fetchevent-type-eventinitdict-eventinitdict"></a></dfn>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑨"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#fetch-event-interface" id="ref-for-fetch-event-interface①"><c- g>FetchEvent</c-></a> : <a class="n" data-link-type="idl-name" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑥"><c- n>ExtendableEvent</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑥"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request"><c- n>Request</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Request" href="#fetch-event-request-attribute" id="ref-for-fetch-event-request-attribute"><c- g>request</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑨"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#fetch-event-clientid-attribute" id="ref-for-fetch-event-clientid-attribute"><c- g>clientId</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#fetch-event-isreload-attribute" id="ref-for-fetch-event-isreload-attribute"><c- g>isReload</c-></a>;

  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#fetch-event-respondwith-method" id="ref-for-fetch-event-respondwith-method"><c- g>respondWith</c-></a>(<c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response"><c- n>Response</c-></a>> <dfn class="idl-code" data-dfn-for="FetchEvent/respondWith(r)" data-dfn-type="argument" data-export id="dom-fetchevent-respondwith-r-r"><code><c- g>r</c-></code><a class="self-link" href="#dom-fetchevent-respondwith-r-r"></a></dfn>);
};
</pre>
<pre class="idl highlight def" id="fetch-event-init-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="dictionary" data-export id="dictdef-fetchevent-fetcheventinit"><code><c- g>FetchEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit①"><c- n>ExtendableEventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①"><c- n>Request</c-></a> <dfn class="idl-code" data-dfn-for="FetchEventInit" data-dfn-type="dict-member" data-export data-type="Request " id="dom-fetcheventinit-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-fetcheventinit-request"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⓪"><c- b>DOMString</c-></a>? <dfn class="idl-code" data-default="null" data-dfn-for="FetchEventInit" data-dfn-type="dict-member" data-export data-type="DOMString? " id="dom-fetcheventinit-clientid"><code><c- g>clientId</c-></code><a class="self-link" href="#dom-fetcheventinit-clientid"></a></dfn> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④"><c- b>boolean</c-></a> <dfn class="idl-code" data-default="false" data-dfn-for="FetchEventInit" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-fetcheventinit-isreload"><code><c- g>isReload</c-></code><a class="self-link" href="#dom-fetcheventinit-isreload"></a></dfn> = <c- b>false</c->;
};
</pre>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⑧">Service workers</a> have an essential <a href="#dfn-functional-events" id="ref-for-dfn-functional-events②">functional event</a> <code><a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event③">fetch</a></code>. For <code><a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event④">fetch</a></code> event, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑥⑨">service workers</a> use the <code><dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="interface" data-export id="fetch-event-interface"><code>FetchEvent</code></dfn></code> interface which extends the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑦">ExtendableEvent</a></code> interface.</p>
     <p>Each event using <code class="idl"><a data-link-type="idl" href="#fetch-event-interface" id="ref-for-fetch-event-interface②">FetchEvent</a></code> interface has an associated <dfn class="dfn-paneled" data-dfn-for="FetchEvent" data-dfn-type="dfn" data-noexport id="fetchevent-potential-response">potential response</dfn> (a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response">response</a>), initially set to null, and the following associated flags that are initially unset: </p>
     <ul>
      <li><dfn class="dfn-paneled" data-dfn-for="FetchEvent" data-dfn-type="dfn" data-noexport id="wait-to-respond-flag">wait to respond flag</dfn>
      <li><dfn class="dfn-paneled" data-dfn-for="FetchEvent" data-dfn-type="dfn" data-noexport id="respond-with-entered-flag">respond-with entered flag</dfn>
      <li><dfn class="dfn-paneled" data-dfn-for="FetchEvent" data-dfn-type="dfn" data-noexport id="respond-with-error-flag">respond-with error flag</dfn>
     </ul>
     <p></p>
     <section>
      <h4 class="heading settled" data-level="4.5.1" id="fetch-event-request"><span class="secno">4.5.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#fetch-event-request-attribute" id="ref-for-fetch-event-request-attribute①">event.request</a></code></span><a class="self-link" href="#fetch-event-request"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="attribute" data-export id="fetch-event-request-attribute"><code>request</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.5.2" id="fetch-event-clientid"><span class="secno">4.5.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#fetch-event-clientid-attribute" id="ref-for-fetch-event-clientid-attribute①">event.clientId</a></code></span><a class="self-link" href="#fetch-event-clientid"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="attribute" data-export id="fetch-event-clientid-attribute"><code>clientId</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event" id="ref-for-concept-event">event</a> is created the attribute <em class="rfc2119" title="MUST">must</em> be initialized to null.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.5.3" id="fetch-event-isreload"><span class="secno">4.5.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#fetch-event-isreload-attribute" id="ref-for-fetch-event-isreload-attribute①">event.isReload</a></code></span><a class="self-link" href="#fetch-event-isreload"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="attribute" data-export id="fetch-event-isreload-attribute"><code>isReload</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event" id="ref-for-concept-event①">event</a> is created the attribute <em class="rfc2119" title="MUST">must</em> be initialized to false.</p>
      <p class="note" role="note">Pressing the refresh button should be considered a reload while clicking a link and pressing the back button should not. The behavior of the <var>Ctrl+l enter</var> is left to the implementations of the user agents.</p>
     </section>
     <section class="algorithm" data-algorithm="fetch-event-respondwith">
      <h4 class="heading settled" data-level="4.5.4" id="fetch-event-respondwith"><span class="secno">4.5.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#fetch-event-respondwith-method" id="ref-for-fetch-event-respondwith-method①">event.respondWith(r)</a></code></span><a class="self-link" href="#fetch-event-respondwith"></a></h4>
      <p class="note" role="note">Developers can set the argument <var>r</var> with either a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③②">promise</a> that resolves with a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①">Response</a></code> object or a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response②">Response</a></code> object (which is automatically cast to a promise). Otherwise, a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error">network error</a> is returned to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch①">Fetch</a>. Renderer-side security checks about tainting for cross-origin content are tied to the types of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-filtered-response" id="ref-for-concept-filtered-response">filtered responses</a> defined in <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch②">Fetch</a>.</p>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="FetchEvent" data-dfn-type="method" data-export id="fetch-event-respondwith-method"><code>respondWith(<var>r</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol data-link-for-hint="FetchEvent">
       <li>
        If the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#dispatch-flag" id="ref-for-dispatch-flag">dispatch flag</a> is unset, then: 
        <ol>
         <li><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw⑨">Throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑥">InvalidStateError</a></code>" exception.
         <li>Abort these steps.
        </ol>
       <li>
        If the <a href="#respond-with-entered-flag" id="ref-for-respond-with-entered-flag">respond-with entered flag</a> is set, then: 
        <ol>
         <li><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⓪">Throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑦">InvalidStateError</a></code>" exception.
         <li>Abort these steps.
        </ol>
       <li>
        Add <var>r</var> to the <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises⑦">extend lifetime promises</a>. 
        <p class="note" role="note"><code class="idl"><a data-link-type="idl" href="#fetch-event-respondwith-method" id="ref-for-fetch-event-respondwith-method②">event.respondWith(r)</a></code> extends the lifetime of the event by default as if <code class="idl"><a data-link-type="idl" href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method③">event.waitUntil(r)</a></code> is called.</p>
       <li>Set the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#stop-propagation-flag" id="ref-for-stop-propagation-flag">stop propagation flag</a> and <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#stop-immediate-propagation-flag" id="ref-for-stop-immediate-propagation-flag">stop immediate propagation flag</a>.
       <li>Set the <a href="#respond-with-entered-flag" id="ref-for-respond-with-entered-flag①">respond-with entered flag</a>.
       <li>Set the <a href="#wait-to-respond-flag" id="ref-for-wait-to-respond-flag">wait to respond flag</a>.
       <li>Let <var>targetRealm</var> be the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm" id="ref-for-concept-relevant-realm①">relevant Realm</a> of the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③⑤">context object</a>. 
       <li>
        Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①①">in parallel</a>: 
        <ol>
         <li>Wait until <var>r</var> settles.
         <li>
          If <var>r</var> rejected, then: 
          <ol>
           <li>Set the <a href="#respond-with-error-flag" id="ref-for-respond-with-error-flag">respond-with error flag</a>.
          </ol>
         <li>
          If <var>r</var> resolved with <var>response</var>, then: 
          <ol>
           <li>
            If <var>response</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response③">Response</a></code> object, then: 
            <ol>
             <li>
              If <var>response</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-disturbed" id="ref-for-concept-body-disturbed">disturbed</a> or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-locked" id="ref-for-concept-body-locked">locked</a>, then: 
              <ol>
               <li>Set the <a href="#respond-with-error-flag" id="ref-for-respond-with-error-flag①">respond-with error flag</a>.
              </ol>
             <li>
              Else: 
              <ol>
               <li>Let <var>bytes</var> be an empty byte sequence. 
               <li>Let <var>end-of-body</var> be false. 
               <li>Let <var>done</var> be false. 
               <li>Let <var>potentialResponse</var> be a copy of <var>response</var>’s associated <a href="https://fetch.spec.whatwg.org/#concept-response-response" id="termref-for-">response</a>, except for its <a data-link-type="dfn">body</a>.
               <li>
                If <var>response</var>’s body is non-null, run these substeps: 
                <ol>
                 <li>Let <var>reader</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-get-reader" id="ref-for-concept-get-reader">getting a reader</a> from <var>response</var>’s <a data-link-type="dfn">body</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream">stream</a>.
                 <li>Let <var>strategy</var> be an object created in <var>targetRealm</var>. The user agent may choose any object.
                 <li>
                  Let <var>pull</var> be an action that runs these subsubsteps: 
                  <ol>
                   <li>Let <var>promise</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream" id="ref-for-concept-read-chunk-from-readablestream">reading</a> a chunk from <var>response</var>’s <a data-link-type="dfn">body</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream①">stream</a> with <var>reader</var>.
                   <li>When <var>promise</var> is fulfilled with an object whose <code>done</code> property is false and whose <code>value</code> property is a <code>Uint8Array</code> object, append the bytes represented by the <code>value</code> property to <var>bytes</var> and perform ! <a href="https://tc39.github.io/ecma262/#sec-detacharraybuffer">DetachArrayBuffer</a> with the <code>ArrayBuffer</code> object wrapped by the <code>value</code> property.
                   <li>When <var>promise</var> is fulfilled with an object whose <code>done</code> property is true, set <var>end-of-body</var> to true.
                   <li>When <var>promise</var> is fulfilled with a value that matches with neither of the above patterns, or <var>promise</var> is rejected, <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-error-readablestream" id="ref-for-concept-error-readablestream">error</a> <var>newStream</var> with a <code>TypeError</code>.
                  </ol>
                 <li>Let <var>cancel</var> be an action that <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream" id="ref-for-concept-cancel-readablestream">cancels</a> <var>response</var>’s <a data-link-type="dfn">body</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream②">stream</a> with <var>reader</var>.
                 <li>Let <var>newStream</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-construct-readablestream" id="ref-for-concept-construct-readablestream">constructing</a> a ReadableStream object with <var>strategy</var>, <var>pull</var> and <var>cancel</var> in <var>targetRealm</var>.
                 <li>Set <var>potentialResponse</var>’s <a data-link-type="dfn">body</a> to a new <a data-link-type="dfn">body</a> whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream③">stream</a> is <var>newStream</var>.
                 <li>Run these subsubsteps repeatedly <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①②">in parallel</a> while <var>done</var> is false:
                 <ol>
                  <li>If <var>newStream</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream-errored" id="ref-for-concept-readablestream-errored">errored</a>, then set <var>done</var> to true.
                  <li>Otherwise, if <var>bytes</var> is empty and <var>end-of-body</var> is true, then <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-close-readablestream" id="ref-for-concept-close-readablestream">close</a> <var>newStream</var> and set <var>done</var> to true.
                  <li>
                   Otherwise, if <var>bytes</var> is not empty, run these subsubsubsteps: 
                   <ol>
                    <li>Let <var>chunk</var> be a subsequence of <var>bytes</var> starting from the beginning of <var>bytes</var>.
                    <li>Remove <var>chunk</var> from <var>bytes</var>. 
                    <li>Let <var>buffer</var> be an <code>ArrayBuffer</code> object created in <var>targetRealm</var> and containing <var>chunk</var>. 
                    <li><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream" id="ref-for-concept-enqueue-readablestream">Enqueue</a> a <code>Uint8Array</code> object created in <var>targetRealm</var> and wrapping <var>buffer</var> to <var>newStream</var>. 
                   </ol>
                 </ol>
                </ol>
                <p class="note" role="note">These substeps are meant to produce the observable equivalent of "piping" <var>response</var>’s <a href="https://fetch.spec.whatwg.org/#concept-body-body">body</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream④">stream</a> into <var>potentialResponse</var>.</p>
               <li>Set the <a data-link-type="dfn" href="#fetchevent-potential-response" id="ref-for-fetchevent-potential-response">potential response</a> to <var>potentialResponse</var>.
              </ol>
            </ol>
           <li>
            Else: 
            <ol>
             <li>Set the <a href="#respond-with-error-flag" id="ref-for-respond-with-error-flag②">respond-with error flag</a>.
            </ol>
            <p class="note" role="note">If the <a href="#respond-with-error-flag" id="ref-for-respond-with-error-flag③">respond-with error flag</a> is set, a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error①">network error</a> is returned to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch③">Fetch</a> through <a href="#on-fetch-request-algorithm">Handle Fetch</a> algorithm. (See the step 21.1.) Otherwise, the value <var>response</var> is returned to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch④">Fetch</a> through <a href="#on-fetch-request-algorithm">Handle Fetch</a> algorithm. (See the step 22.1.)</p>
          </ol>
         <li>Unset the <a href="#wait-to-respond-flag" id="ref-for-wait-to-respond-flag①">wait to respond flag</a>.
        </ol>
      </ol>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.6" id="extendablemessage-event-section"><span class="secno">4.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-interface" id="ref-for-extendablemessage-event-interface①">ExtendableMessageEvent</a></code></span><a class="self-link" href="#extendablemessage-event-section"></a></h3>
<pre class="idl highlight def">[<dfn class="idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="constructor" data-export data-lt="ExtendableMessageEvent(type, eventInitDict)|ExtendableMessageEvent(type)" id="dom-extendablemessageevent-extendablemessageevent"><code><c- g>Constructor</c-></code><a class="self-link" href="#dom-extendablemessageevent-extendablemessageevent"></a></dfn>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableMessageEvent/ExtendableMessageEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-type"><code><c- g>type</c-></code><a class="self-link" href="#dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-type"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendablemessageevent-extendablemessageeventinit" id="ref-for-dictdef-extendablemessageevent-extendablemessageeventinit"><c- n>ExtendableMessageEventInit</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableMessageEvent/ExtendableMessageEvent(type, eventInitDict)" data-dfn-type="argument" data-export id="dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code><a class="self-link" href="#dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-eventinitdict"></a></dfn>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①⓪"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#extendablemessage-event-interface" id="ref-for-extendablemessage-event-interface②"><c- g>ExtendableMessageEvent</c-></a> : <a class="n" data-link-type="idl-name" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑧"><c- n>ExtendableEvent</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#extendablemessage-event-data-attribute" id="ref-for-extendablemessage-event-data-attribute①"><c- g>data</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①②"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#extendablemessage-event-origin-attribute" id="ref-for-extendablemessage-event-origin-attribute①"><c- g>origin</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①③"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#extendablemessage-event-lasteventid-attribute" id="ref-for-extendablemessage-event-lasteventid-attribute"><c- g>lastEventId</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑦"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> (<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface⑤"><c- n>Client</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②④"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑦"><c- n>MessagePort</c-></a>)? <a class="idl-code" data-link-type="attribute" data-readonly data-type="(Client or ServiceWorker or MessagePort)?" href="#extendablemessage-event-source-attribute" id="ref-for-extendablemessage-event-source-attribute②"><c- g>source</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑧"><c- n>MessagePort</c-></a>>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<MessagePort>?" href="#extendablemessage-event-ports-attribute" id="ref-for-extendablemessage-event-ports-attribute①"><c- g>ports</c-></a>;
};
</pre>
<pre class="idl highlight def" id="extendablemessage-event-init-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="dictionary" data-export id="dictdef-extendablemessageevent-extendablemessageeventinit"><code><c- g>ExtendableMessageEventInit</c-></code></dfn> : <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit②"><c- n>ExtendableEventInit</c-></a> {
  <c- b>any</c-> <dfn class="idl-code" data-dfn-for="ExtendableMessageEventInit" data-dfn-type="dict-member" data-export data-type="any " id="dom-extendablemessageeventinit-data"><code><c- g>data</c-></code><a class="self-link" href="#dom-extendablemessageeventinit-data"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①④"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableMessageEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-extendablemessageeventinit-origin"><code><c- g>origin</c-></code><a class="self-link" href="#dom-extendablemessageeventinit-origin"></a></dfn>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑤"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="ExtendableMessageEventInit" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-extendablemessageeventinit-lasteventid"><code><c- g>lastEventId</c-></code><a class="self-link" href="#dom-extendablemessageeventinit-lasteventid"></a></dfn>;
  (<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface⑥"><c- n>Client</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②⑤"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑨"><c- n>MessagePort</c-></a>)? <dfn class="idl-code" data-dfn-for="ExtendableMessageEventInit" data-dfn-type="dict-member" data-export data-type="(Client or ServiceWorker or MessagePort)? " id="dom-extendablemessageeventinit-source"><code><c- g>source</c-></code><a class="self-link" href="#dom-extendablemessageeventinit-source"></a></dfn>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport①⓪"><c- n>MessagePort</c-></a>>? <dfn class="idl-code" data-dfn-for="ExtendableMessageEventInit" data-dfn-type="dict-member" data-export data-type="sequence<MessagePort>? " id="dom-extendablemessageeventinit-ports"><code><c- g>ports</c-></code><a class="self-link" href="#dom-extendablemessageeventinit-ports"></a></dfn>;
};
</pre>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⓪">Service workers</a> define the <a href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method⑤">extendable</a> <a href="#service-worker-global-scope-message-event" id="ref-for-service-worker-global-scope-message-event②">message</a> event that extends the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/indices.html#event-message" id="ref-for-event-message①">message</a></code> event defined in <a data-link-type="biblio" href="#biblio-html">[HTML]</a> to allow extending the lifetime of the event. For the <a href="#service-worker-global-scope-message-event" id="ref-for-service-worker-global-scope-message-event③">message</a> event, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦①">service workers</a> use the <code><dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="interface" data-export id="extendablemessage-event-interface"><code>ExtendableMessageEvent</code></dfn></code> interface which extends the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑨">ExtendableEvent</a></code> interface.</p>
     <section>
      <h4 class="heading settled" data-level="4.6.1" id="extendablemessage-event-data"><span class="secno">4.6.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-data-attribute" id="ref-for-extendablemessage-event-data-attribute②">event.data</a></code></span><a class="self-link" href="#extendablemessage-event-data"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="attribute" data-export id="extendablemessage-event-data-attribute"><code>data</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the message being sent.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.6.2" id="extendablemessage-event-origin"><span class="secno">4.6.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-origin-attribute" id="ref-for-extendablemessage-event-origin-attribute②">event.origin</a></code></span><a class="self-link" href="#extendablemessage-event-origin"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="attribute" data-export id="extendablemessage-event-origin-attribute"><code>origin</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to the empty string. It represents the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⑧">origin</a> of the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client②⑨">service worker client</a> that sent the message.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.6.3" id="extendablemessage-event-lasteventid"><span class="secno">4.6.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-lasteventid-attribute" id="ref-for-extendablemessage-event-lasteventid-attribute①">event.lastEventId</a></code></span><a class="self-link" href="#extendablemessage-event-lasteventid"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="attribute" data-export id="extendablemessage-event-lasteventid-attribute"><code>lastEventId</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to the empty string.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.6.4" id="extendablemessage-event-source"><span class="secno">4.6.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-source-attribute" id="ref-for-extendablemessage-event-source-attribute③">event.source</a></code></span><a class="self-link" href="#extendablemessage-event-source"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="attribute" data-export id="extendablemessage-event-source-attribute"><code>source</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the <code class="idl"><a data-link-type="idl" href="#client-interface" id="ref-for-client-interface⑦">Client</a></code> object from which the message is sent.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="4.6.5" id="extendablemessage-event-ports"><span class="secno">4.6.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-ports-attribute" id="ref-for-extendablemessage-event-ports-attribute②">event.ports</a></code></span><a class="self-link" href="#extendablemessage-event-ports"></a></h4>
      <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="ExtendableMessageEvent" data-dfn-type="attribute" data-export id="extendablemessage-event-ports-attribute"><code>ports</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to. When the object is created, this attribute <em class="rfc2119" title="MUST">must</em> be initialized to null. It represents the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport①①">MessagePort</a></code> array being sent, if any.</p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="4.7" id="execution-context-events"><span class="secno">4.7. </span><span class="content">Events</span><a class="self-link" href="#execution-context-events"></a></h3>
     <p>The following events are dispatched on <a href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①⑤">ServiceWorkerGlobalScope</a> object:</p>
     <table class="data">
      <thead>
       <tr>
        <th>Event name
        <th>Interface
        <th>Dispatched when…
      <tbody>
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="service-worker-global-scope-install-event"><code>install</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface①⓪">ExtendableEvent</a></code>
        <td>[<a href="#dfn-lifecycle-events" id="ref-for-dfn-lifecycle-events①">Lifecycle event</a>] The <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⑤">service worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration⑧">containing service worker registration</a>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⓪">installing worker</a> changes. (See step 11.2 of the <a href="#installation-algorithm">Install</a> algorithm.)
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="service-worker-global-scope-activate-event"><code>activate</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface①①">ExtendableEvent</a></code>
        <td>[<a href="#dfn-lifecycle-events" id="ref-for-dfn-lifecycle-events②">Lifecycle event</a>] The <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⑥">service worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration⑨">containing service worker registration</a>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②②">active worker</a> changes. (See step 12.2 of the <a href="#activation-algorithm">Activate</a> algorithm.)
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="service-worker-global-scope-fetch-event"><code>fetch</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="#fetch-event-interface" id="ref-for-fetch-event-interface③">FetchEvent</a></code>
        <td>[<a href="#dfn-functional-events" id="ref-for-dfn-functional-events③">Functional event</a>] The <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-http-fetch" id="ref-for-concept-http-fetch">http fetch</a> invokes <a href="#on-fetch-request-algorithm">Handle Fetch</a> with <var>request</var>. As a result of performing <a href="#on-fetch-request-algorithm">Handle Fetch</a>, the <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⑦">service worker</a> returns a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response①">response</a> to the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-http-fetch" id="ref-for-concept-http-fetch①">http fetch</a>. The <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response②">response</a>, represented by a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response④">Response</a></code> object, can be retrieved from a <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface">Cache</a></code> object or directly from network using <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-global-fetch" id="ref-for-dom-global-fetch">self.fetch(input, init)</a></code> method. (A custom <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑤">Response</a></code> object can be another option.)
       <tr>
        <td><dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="event" data-export id="service-worker-global-scope-message-event"><code>message</code></dfn>
        <td><code class="idl"><a data-link-type="idl" href="#extendablemessage-event-interface" id="ref-for-extendablemessage-event-interface③">ExtendableMessageEvent</a></code>
        <td>When it receives a message.
     </table>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="5" id="cache-objects"><span class="secno">5. </span><span class="content">Caches</span><a class="self-link" href="#cache-objects"></a></h2>
    <p>To allow authors to fully manage their content caches for offline use, the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑧">Window</a></code> and the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope" id="ref-for-workerglobalscope①">WorkerGlobalScope</a></code> provide the asynchronous caching methods that open and manipulate <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①">Cache</a></code> objects. An <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2①⑨">origin</a> can have multiple, named <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface②">Cache</a></code> objects, whose contents are entirely under the control of scripts. Caches are not shared across <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⓪">origins</a>, and they are completely isolated from the browser’s HTTP cache.</p>
    <section>
     <h3 class="heading settled" data-level="5.1" id="cache-constructs"><span class="secno">5.1. </span><span class="content">Constructs</span><a class="self-link" href="#cache-constructs"></a></h3>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-fetching-record">fetching record</dfn> is a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type③">Record</a> {[[key]], [[value]]} where [[key]] is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②">Request</a></code> and [[value]] is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑥">Response</a></code>.</p>
     <p>A <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record">fetching record</a> has an associated <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-incumbent-record">incumbent record</dfn> (a <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record①">fetching record</a>). It is initially set to null.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-request-to-response-map">request to response map</dfn> is a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type④">List</a> of <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record②">fetching records</a>.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-name-to-cache-map">name to cache map</dfn> is a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type⑤">List</a> of the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type⑥">Record</a> {[[key]], [[value]]} where [[key]] is a string that represents a name of the <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface③">Cache</a></code> object and [[value]] is a <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface④">Cache</a></code> object.</p>
     <p>Each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②①">origin</a> has an associated <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map">name to cache map</a>.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.2" id="cache-lifetimes"><span class="secno">5.2. </span><span class="content">Understanding Cache Lifetimes</span><a class="self-link" href="#cache-lifetimes"></a></h3>
     <p>The <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface⑤">Cache</a></code> instances are not part of the browser’s HTTP cache. The <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface⑥">Cache</a></code> objects are exactly what authors have to manage themselves. The <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface⑦">Cache</a></code> objects do not get updated unless authors explicitly request them to be. The <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface⑧">Cache</a></code> objects do not expire unless authors delete the entries. The <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface⑨">Cache</a></code> objects do not disappear just because the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦②">service worker</a> script is updated. That is, caches are not updated automatically. Updates must be manually managed. This implies that authors should version their caches by name and make sure to use the caches only from the version of the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦③">service worker</a> that can safely operate on.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.3" id="self-caches"><span class="secno">5.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#global-caches-attribute" id="ref-for-global-caches-attribute">self.caches</a></code></span><a class="self-link" href="#self-caches"></a></h3>
<pre class="idl highlight def"><c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope" id="ref-for-windoworworkerglobalscope"><c- g>WindowOrWorkerGlobalScope</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑧"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cache-storage-interface" id="ref-for-cache-storage-interface"><c- n>CacheStorage</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CacheStorage" href="#global-caches-attribute" id="ref-for-global-caches-attribute①"><c- g>caches</c-></a>;
};
</pre>
     <section>
      <h4 class="heading settled" data-level="5.3.1" id="global-caches"><span class="secno">5.3.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#global-caches-attribute" id="ref-for-global-caches-attribute②">caches</a></code></span><a class="self-link" href="#global-caches"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="WindowOrWorkerGlobalScope" data-dfn-type="attribute" data-export id="global-caches-attribute"><code>caches</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return this object’s associated <code class="idl"><a data-link-type="idl" href="#cache-storage-interface" id="ref-for-cache-storage-interface①">CacheStorage</a></code> object.</p>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.4" id="cache"><span class="secno">5.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⓪">Cache</a></code></span><a class="self-link" href="#cache"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑥"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#cache-interface" id="ref-for-cache-interface①①"><c- g>Cache</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①②"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#cache-match-method" id="ref-for-cache-match-method"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/match(request, options), Cache/match(request)" data-dfn-type="argument" data-export id="dom-cache-match-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-match-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="Cache/match(request, options), Cache/match(request)" data-dfn-type="argument" data-export id="dom-cache-match-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cache-match-request-options-options"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①③"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑦"><c- n>Response</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-matchall-method" id="ref-for-cache-matchall-method"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo①"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/matchAll(request, options), Cache/matchAll(request), Cache/matchAll()" data-dfn-type="argument" data-export id="dom-cache-matchall-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-matchall-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions①"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="Cache/matchAll(request, options), Cache/matchAll(request), Cache/matchAll()" data-dfn-type="argument" data-export id="dom-cache-matchall-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cache-matchall-request-options-options"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①④"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-add-method" id="ref-for-cache-add-method"><c- g>add</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo②"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/add(request)" data-dfn-type="argument" data-export id="dom-cache-add-request-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-add-request-request"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑤"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-addAll-method" id="ref-for-cache-addAll-method"><c- g>addAll</c-></a>(<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo③"><c- n>RequestInfo</c-></a>> <dfn class="idl-code" data-dfn-for="Cache/addAll(requests)" data-dfn-type="argument" data-export id="dom-cache-addall-requests-requests"><code><c- g>requests</c-></code><a class="self-link" href="#dom-cache-addall-requests-requests"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑥"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-put-method" id="ref-for-cache-put-method"><c- g>put</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo④"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/put(request, response)" data-dfn-type="argument" data-export id="dom-cache-put-request-response-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-put-request-response-request"></a></dfn>, <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑧"><c- n>Response</c-></a> <dfn class="idl-code" data-dfn-for="Cache/put(request, response)" data-dfn-type="argument" data-export id="dom-cache-put-request-response-response"><code><c- g>response</c-></code><a class="self-link" href="#dom-cache-put-request-response-response"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑦"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-delete-method" id="ref-for-cache-delete-method"><c- g>delete</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑤"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/delete(request, options), Cache/delete(request)" data-dfn-type="argument" data-export id="dom-cache-delete-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-delete-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions②"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="Cache/delete(request, options), Cache/delete(request)" data-dfn-type="argument" data-export id="dom-cache-delete-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cache-delete-request-options-options"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑧"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request③"><c- n>Request</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-keys-method" id="ref-for-cache-keys-method"><c- g>keys</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑥"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="Cache/keys(request, options), Cache/keys(request), Cache/keys()" data-dfn-type="argument" data-export id="dom-cache-keys-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cache-keys-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions③"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="Cache/keys(request, options), Cache/keys(request), Cache/keys()" data-dfn-type="argument" data-export id="dom-cache-keys-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cache-keys-request-options-options"></a></dfn>);
};
</pre>
<pre class="idl highlight def" id="cache-query-options-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="dictionary" data-export id="dictdef-cache-cachequeryoptions"><code><c- g>CacheQueryOptions</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="CacheQueryOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-cachequeryoptions-ignoresearch"><code><c- g>ignoreSearch</c-></code></dfn> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="CacheQueryOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-cachequeryoptions-ignoremethod"><code><c- g>ignoreMethod</c-></code></dfn> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧"><c- b>boolean</c-></a> <dfn class="dfn-paneled idl-code" data-default="false" data-dfn-for="CacheQueryOptions" data-dfn-type="dict-member" data-export data-type="boolean " id="dom-cachequeryoptions-ignorevary"><code><c- g>ignoreVary</c-></code></dfn> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑥"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CacheQueryOptions" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-cachequeryoptions-cachename"><code><c- g>cacheName</c-></code></dfn>;
};
</pre>
<pre class="idl highlight def" id="cache-batch-operation-dictionary"><c- b>dictionary</c-> <dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="dictionary" data-export id="dictdef-cache-cachebatchoperation"><code><c- g>CacheBatchOperation</c-></code></dfn> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑦"><c- b>DOMString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CacheBatchOperation" data-dfn-type="dict-member" data-export data-type="DOMString " id="dom-cachebatchoperation-type"><code><c- g>type</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request④"><c- n>Request</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CacheBatchOperation" data-dfn-type="dict-member" data-export data-type="Request " id="dom-cachebatchoperation-request"><code><c- g>request</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑨"><c- n>Response</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CacheBatchOperation" data-dfn-type="dict-member" data-export data-type="Response " id="dom-cachebatchoperation-response"><code><c- g>response</c-></code></dfn>;
  <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions④"><c- n>CacheQueryOptions</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="CacheBatchOperation" data-dfn-type="dict-member" data-export data-type="CacheQueryOptions " id="dom-cachebatchoperation-options"><code><c- g>options</c-></code></dfn>;
};
</pre>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="interface" data-export id="cache-interface"><code>Cache</code></dfn></code> object represents a <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map">request to response map</a>. Multiple separate objects implementing the <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①②">Cache</a></code> interface across documents and workers can all be associated with the same <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①">request to response map</a> simultaneously.</p>
     <p><code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①③">Cache</a></code> objects are always enumerable via <code class="idl"><a data-link-type="idl" href="#global-caches-attribute" id="ref-for-global-caches-attribute③">self.caches</a></code> in insertion order (per <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects" id="ref-for-sec-map-objects">ECMAScript 6 Map objects</a>).</p>
     <section class="algorithm" data-algorithm="cache-match">
      <h4 class="heading settled" data-level="5.4.1" id="cache-match"><span class="secno">5.4.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-match-method" id="ref-for-cache-match-method①">match(request, options)</a></code></span><a class="self-link" href="#cache-match"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export data-lt="match(request, options)|match(request)" id="cache-match-method"><code>match(<var>request</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③③">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①③">in parallel</a>: 
        <ol>
         <li>Let <var>p</var> be the result of running the algorithm specified in <code class="idl"><a data-link-type="idl" href="#cache-matchall-method" id="ref-for-cache-matchall-method①">matchAll(request, options)</a></code> method with <var>request</var> and <var>options</var> as the arguments.
         <li>Wait until <var>p</var> settles.
         <li>
          If <var>p</var> rejects with an exception, then: 
          <ol>
           <li>Reject <var>promise</var> with that exception.
          </ol>
         <li>
          Else if <var>p</var> resolves with an array, <var>responseArray</var>, then: 
          <ol>
           <li>
            If <var>responseArray</var> is an empty array, then: 
            <ol>
             <li>Resolve <var>promise</var> with undefined.
            </ol>
           <li>
            Else: 
            <ol>
             <li>Resolve <var>promise</var> with the first element of <var>responseArray</var>.
            </ol>
          </ol>
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-matchall">
      <h4 class="heading settled" data-level="5.4.2" id="cache-matchall"><span class="secno">5.4.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-matchall-method" id="ref-for-cache-matchall-method②">matchAll(request, options)</a></code></span><a class="self-link" href="#cache-matchall"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export data-lt="matchAll(request, options)|matchAll(request)|matchAll()" id="cache-matchall-method"><code>matchAll(<var>request</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>r</var> be null.
       <li>
        If the optional argument <var>request</var> is not omitted, then: 
        <ol>
         <li>
          If <var>request</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request⑤">Request</a></code> object, then: 
          <ol>
           <li>Set <var>r</var> to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request">request</a>.
           <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method">method</a> is not `<code>GET</code>` and <var>options</var>.<var>ignoreMethod</var> is false, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③④">promise</a> resolved with an empty array.
          </ol>
         <li>
          Else if <var>request</var> is a string, then: 
          <ol>
           <li>Set <var>r</var> to the associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①">request</a> of the result of invoking the initial value of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request⑥">Request</a></code> as constructor with <var>request</var> as its argument. If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①①">throws</a> an exception, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⑤">promise</a> rejected with that exception.
          </ol>
        </ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⑥">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①④">in parallel</a>: 
        <ol>
         <li>Let <var>responseArray</var> be an empty array.
         <li>
          If the optional argument <var>request</var> is omitted, then: 
          <ol>
           <li>
            For each <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record③">fetching record</a> <var>entry</var> of its <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map②">request to response map</a>, in key insertion order: 
            <ol>
             <li>Add a  copy of <var>entry</var>.[[value]] to <var>responseArray</var>.
            </ol>
           <li>Resolve <var>promise</var> with <var>responseArray</var>.
           <li>Abort these steps.
          </ol>
         <li>
          Else: 
          <ol>
           <li>Let <var>entries</var> be the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request⑦">Request</a></code> object associated with <var>r</var> and <var>options</var> as the arguments.
           <li>
            For each <var>entry</var> of <var>entries</var>: 
            <ol>
             <li>Let <var>response</var> be null.
             <li>If the <a href="#dfn-incumbent-record" id="ref-for-dfn-incumbent-record">incumbent record</a> <var>incumbentRecord</var> of the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record④">fetching record</a> <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map③">request to response map</a> is not null, set <var>response</var> to a copy of <var>incumbentRecord</var>.[[value]].
             <li>Else, set <var>response</var> to a copy of <var>entry</var>[1].
             <li>Add <var>response</var> to <var>responseArray</var>.
            </ol>
           <li>Resolve <var>promise</var> with <var>responseArray</var>.
          </ol>
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-add">
      <h4 class="heading settled" data-level="5.4.3" id="cache-add"><span class="secno">5.4.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-add-method" id="ref-for-cache-add-method①">add(request)</a></code></span><a class="self-link" href="#cache-add"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export id="cache-add-method"><code>add(<var>request</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>requests</var> be an array containing only <var>request</var>.
       <li>Set <var>responseArrayPromise</var> to the result of running the algorithm specified in <code class="idl"><a data-link-type="idl" href="#cache-addAll-method" id="ref-for-cache-addAll-method①">addAll(requests)</a></code> passing <var>requests</var> as the argument.
       <li>Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by">transforming</a> <var>responseArrayPromise</var> with a fulfillment handler that returns undefined.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-addAll">
      <h4 class="heading settled" data-level="5.4.4" id="cache-addAll"><span class="secno">5.4.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-addAll-method" id="ref-for-cache-addAll-method②">addAll(requests)</a></code></span><a class="self-link" href="#cache-addAll"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export id="cache-addAll-method"><code>addAll(<var>requests</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>responsePromiseArray</var> be an empty array.
       <li>Let <var>requestArray</var> be an empty array.
       <li>
        For each <var>request</var> whose type is <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request⑧">Request</a></code> in <var>requests</var>: 
        <ol>
         <li>Let <var>r</var> be <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request②">request</a>.
         <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url③">url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme②">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", or <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method①">method</a> is not `<code>GET</code>`, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⑦">promise</a> rejected with a <code>TypeError</code>.
        </ol>
       <li>
        For each <var>request</var> in <var>requests</var>: 
        <ol>
         <li>Let <var>r</var> be the associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request③">request</a> of the result of invoking the initial value of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request⑨">Request</a></code> as constructor with <var>request</var> as its argument. If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①②">throws</a> an exception, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⑧">promise</a> rejected with that exception.
         <li>
          If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url④">url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme③">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", then: 
          <ol>
           <li><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch-terminate" id="ref-for-concept-fetch-terminate">Terminate</a> all the ongoing <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch⑤">fetches</a> initiated by <var>requests</var> with reason <em>fatal</em>.
           <li>Break the loop.
          </ol>
         <li>Set <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-initiator" id="ref-for-concept-request-initiator">initiator</a> to "<code>fetch</code>" and <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination" id="ref-for-concept-request-destination">destination</a> to "<code>subresource</code>".
         <li>Add a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⓪">Request</a></code> object associated with <var>r</var> to <var>requestArray</var>.
         <li>Let <var>responsePromise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects③⑨">promise</a>.
         <li>
          Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑤">in parallel</a>: 
          <ul>
           <li><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch⑥">Fetch</a> <var>r</var>.
           <li>
            To <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-response" id="ref-for-process-response">process response</a> for <var>response</var>, run these substeps: 
            <ol>
             <li>If <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-type" id="ref-for-concept-response-type">type</a> is <em>error</em>, or <var>response</var>’s <a data-link-type="dfn">status</a> is not an <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#ok-status" id="ref-for-ok-status">ok status</a>, reject <var>responsePromise</var> with a <code>TypeError</code>.
             <li>
              Else if <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list">header list</a> contains a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header">header</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-name" id="ref-for-concept-header-name">named</a> `<code>Vary</code>`, then: 
              <ol>
               <li>Let <var>varyHeaders</var> be the array containing the elements corresponding to the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7230#section-3.2" id="ref-for-section-3.2">field-values</a> of the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-7.1.4" id="ref-for-section-7.1.4">Vary</a> header.
               <li>Let <var>matchAsterisk</var> be false.
               <li>
                For each <var>f</var> in <var>varyHeaders</var>: 
                <ol>
                 <li>If <var>f</var> matches "<code>*</code>", set <var>matchAsterisk</var> to true and break the loop.
                </ol>
               <li>If <var>matchAsterisk</var> is true, reject <var>responsePromise</var> with a <code>TypeError</code>.
               <li>Else, resolve <var>responsePromise</var> with a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⓪">Response</a></code> object associated with <var>response</var> and a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers">Headers</a></code> object whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-headers-guard" id="ref-for-concept-headers-guard">guard</a> is "<code>immutable</code>".
              </ol>
             <li>Else, resolve <var>responsePromise</var> with a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①①">Response</a></code> object associated with <var>response</var> and a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers①">Headers</a></code> object whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-headers-guard" id="ref-for-concept-headers-guard①">guard</a> is "<code>immutable</code>".
            </ol>
            <p class="note" role="note">This step ensures that the promise for this fetch resolves as soon as the response’s headers become available.</p>
           <li>To <a data-link-type="dfn">process response body</a> for <var>response</var>, do nothing.
           <li>To <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-response-end-of-file" id="ref-for-process-response-end-of-file">process response end-of-file</a> for <var>response</var>, do nothing.
          </ul>
         <li>Add <var>responsePromise</var> to <var>responsePromiseArray</var>.
        </ol>
       <li>Let <var>p</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all" id="ref-for-waiting-for-all">waiting for all</a> of <var>responsePromiseArray</var>.
       <li>
        Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by①">transforming</a> <var>p</var> with a fulfillment handler that, when called with argument <var>responseArray</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑥">in parallel</a>: 
        <ol>
         <li>Let <var>operations</var> be an empty array.
         <li>
          For each <var>response</var> in <var>responseArray</var> with the index <var>index</var>: 
          <ol>
           <li>Let <var>o</var> be an empty object representing a <code class="idl"><a data-link-type="idl" href="#dictdef-cache-cachebatchoperation" id="ref-for-dictdef-cache-cachebatchoperation">CacheBatchOperation</a></code> dictionary.
           <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type">type</a></code> dictionary member of <var>o</var> to "put".
           <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request">request</a></code> dictionary member of <var>o</var> to <var>requestArray</var>[<var>index</var>].
           <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response">response</a></code> dictionary member of <var>o</var> to <var>response</var>.
           <li>Add <var>o</var> to <var>operations</var>.
          </ol>
         <li>Let <var>resultPromise</var> be the result of running <a href="#batch-cache-operations-algorithm">Batch Cache Operations</a> algorithm passing <var>operations</var> as the argument.
         <li>
          Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by②">transforming</a> <var>resultPromise</var> with a fulfillment handler that, when called with argument <var>responses</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑦">in parallel</a>: 
          <ol>
           <li>Let <var>responseBodyPromiseArray</var> be an empty array.
           <li>
            For each <var>response</var> in <var>responses</var>: 
            <ol>
             <li>Let <var>responseBodyPromise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⓪">promise</a>.
             <li>
              Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑧">in parallel</a>: 
              <ol>
               <li>Wait for either end-of-file to have been pushed to <var>response</var>’s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response①">response</a> <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body">body</a> or for <var>r</var> to have a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-termination-reason" id="ref-for-concept-response-termination-reason">termination reason</a>.
               <li>
                If <var>r</var> had a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-termination-reason" id="ref-for-concept-response-termination-reason①">termination reason</a>, then: 
                <ol>
                 <li>
                  If the <a href="#dfn-incumbent-record" id="ref-for-dfn-incumbent-record①">incumbent record</a> <var>incumbentRecord</var> of the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record⑤">fetching record</a> <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map④">request to response map</a> is not null, then: 
                  <ol>
                   <li>Set <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map⑤">request to response map</a> to the copy of <var>incumbentRecord</var>.
                  </ol>
                 <li>
                  Else: 
                  <ol>
                   <li>Delete <var>fetchingRecord</var> from <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map⑥">request to response map</a>.
                  </ol>
                 <li>Reject <var>responseBodyPromise</var> with a <code>TypeError</code>.
                </ol>
               <li>
                Else: 
                <ol>
                 <li>Set the <a href="#dfn-incumbent-record" id="ref-for-dfn-incumbent-record②">incumbent record</a> of the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record⑥">fetching record</a> <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map⑦">request to response map</a> to the copy of <var>fetchingRecord</var>.
                 <li>Let <var>invalidRecords</var> be the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing <var>fetchingRecord</var>.[[key]] as the argument.
                 <li>
                  For each <var>invalidRecord</var> in <var>invalidRecords</var>: 
                  <ol>
                   <li>If <var>invalidRecord</var> is not <var>fetchingRecord</var>, delete it from <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map⑧">request to response map</a>.
                  </ol>
                 <li>Resolve <var>responseBodyPromise</var> with <var>response</var>.
                </ol>
              </ol>
             <li>Add <var>responseBodyPromise</var> to <var>responseBodyPromiseArray</var>.
            </ol>
           <li>Let <var>q</var> be <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all" id="ref-for-waiting-for-all①">waiting for all</a> of <var>responseBodyPromiseArray</var>.
           <li>Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by③">transforming</a> <var>q</var> with a fulfillment handler that returns undefined.
          </ol>
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-put">
      <h4 class="heading settled" data-level="5.4.5" id="cache-put"><span class="secno">5.4.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-put-method" id="ref-for-cache-put-method①">put(request, response)</a></code></span><a class="self-link" href="#cache-put"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export id="cache-put-method"><code>put(<var>request</var>, <var>response</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>r</var> be null.
       <li>
        If <var>request</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①①">Request</a></code> object, then: 
        <ol>
         <li>Set <var>r</var> to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request④">request</a>.
         <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url⑤">url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme④">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", or <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method②">method</a> is not `<code>GET</code>`, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④①">promise</a> rejected with a <code>TypeError</code>.
        </ol>
       <li>
        Else if <var>request</var> is a string, then: 
        <ol>
         <li>Set <var>r</var> to the associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request⑤">request</a> of the result of invoking the initial value of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①②">Request</a></code> as constructor with <var>request</var> as its argument. If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①③">throws</a> an exception, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④②">promise</a> rejected with that exception.
         <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url⑥">url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme⑤">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④③">promise</a> rejected with a <code>TypeError</code>.
        </ol>
       <li>
        If <var>response</var>’s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response②">response</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list①">header list</a> contains a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header①">header</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-name" id="ref-for-concept-header-name①">named</a> `<code>Vary</code>`, then: 
        <ol>
         <li>Let <var>varyHeaders</var> be the array containing the elements corresponding to the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7230#section-3.2" id="ref-for-section-3.2①">field-values</a> of the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-7.1.4" id="ref-for-section-7.1.4①">Vary</a> header.
         <li>
          For each <var>f</var> in <var>varyHeaders</var>: 
          <ol>
           <li>If <var>f</var> matches "<code>*</code>", return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④④">promise</a> rejected with a <code>TypeError</code>.
          </ol>
        </ol>
       <li>If <var>response</var> is <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-disturbed" id="ref-for-concept-body-disturbed①">disturbed</a> or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-locked" id="ref-for-concept-body-locked①">locked</a>, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⑤">promise</a> rejected with a <code>TypeError</code>.
       <li>Let <var>newResponse</var> be a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①②">Response</a></code> object associated with <var>response</var>’s associated <a href="https://fetch.spec.whatwg.org/#concept-response-response" id="termref-for-①">response</a> and a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers②">Headers</a></code> object whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-headers-guard" id="ref-for-concept-headers-guard②">guard</a> is <var>response</var>’s <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#headers" id="ref-for-headers③">Headers</a></code>' <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-headers-guard" id="ref-for-concept-headers-guard③">guard</a>.
       <li>
        If <var>response</var>’s body is non-null, run these substeps: 
        <ol>
         <li>Let <var>dummyStream</var> be an <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-empty-readablestream" id="ref-for-concept-empty-readablestream">empty</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-readablestream" id="ref-for-concept-readablestream">ReadableStream</a> object.
         <li>Set <var>response</var>’s <a href="https://fetch.spec.whatwg.org/#concept-body-body">body</a> to a new <a data-link-type="dfn">body</a> whose <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-body-stream" id="ref-for-concept-body-stream⑤">stream</a> is <var>dummyStream</var>.
         <li>Let <var>reader</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-get-reader" id="ref-for-concept-get-reader①">getting a reader</a> from <var>dummyStream</var>.
         <li><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream" id="ref-for-concept-read-all-bytes-from-readablestream">Read all bytes</a> from <var>dummyStream</var> with <var>reader</var>.
        </ol>
       <li>Let <var>operations</var> be an empty array.
       <li>Let <var>o</var> be an empty object representing a <code class="idl"><a data-link-type="idl" href="#dictdef-cache-cachebatchoperation" id="ref-for-dictdef-cache-cachebatchoperation①">CacheBatchOperation</a></code> dictionary.
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type①">type</a></code> dictionary member of <var>o</var> to "put".
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request①">request</a></code> dictionary member of <var>o</var> to a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①③">Request</a></code> object associated with <var>r</var>.
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response①">response</a></code> dictionary member of <var>o</var> to <var>newResponse</var>.
       <li>Add <var>o</var> to <var>operations</var>.
       <li>Let <var>resultPromise</var> be the result of running <a href="#batch-cache-operations-algorithm">Batch Cache Operations</a> passing <var>operations</var> as the argument.
       <li>
        Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by④">transforming</a> <var>resultPromise</var> with a fulfillment handler that, when called with argument <var>responses</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel①⑨">in parallel</a>: 
        <ol>
         <li>Wait for either end-of-file to have been pushed to <var>responses</var>[0]'s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response③">response</a> <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-body" id="ref-for-concept-response-body①">body</a> or for <var>r</var> to have a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-termination-reason" id="ref-for-concept-response-termination-reason②">termination reason</a>.
         <li>
          If <var>r</var> had a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-termination-reason" id="ref-for-concept-response-termination-reason③">termination reason</a>, then: 
          <ol>
           <li>
            If the <a href="#dfn-incumbent-record" id="ref-for-dfn-incumbent-record③">incumbent record</a> <var>incumbentRecord</var> of the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record⑦">fetching record</a> <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map⑨">request to response map</a> is not null, then: 
            <ol>
             <li>Set <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⓪">request to response map</a> to the copy of <var>incumbentRecord</var>.
            </ol>
           <li>
            Else: 
            <ol>
             <li>Delete <var>fetchingRecord</var> from <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①①">request to response map</a>.
            </ol>
           <li><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①④">Throw</a> a <code>TypeError</code>.
          </ol>
         <li>
          Else: 
          <ol>
           <li>Set the <a href="#dfn-incumbent-record" id="ref-for-dfn-incumbent-record④">incumbent record</a> of the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record⑧">fetching record</a> <var>fetchingRecord</var> in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①②">request to response map</a> to the copy of <var>fetchingRecord</var>.
           <li>Let <var>invalidRecords</var> be the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing <var>fetchingRecord</var>.[[key]] as the argument.
           <li>
            For each <var>invalidRecord</var> in <var>invalidRecords</var>: 
            <ol>
             <li>If <var>invalidRecord</var> is not <var>fetchingRecord</var>, delete it from <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①③">request to response map</a>.
            </ol>
           <li>Return undefined.
          </ol>
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-delete">
      <h4 class="heading settled" data-level="5.4.6" id="cache-delete"><span class="secno">5.4.6. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-delete-method" id="ref-for-cache-delete-method①">delete(request, options)</a></code></span><a class="self-link" href="#cache-delete"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export data-lt="delete(request, options)|delete(request)" id="cache-delete-method"><code>delete(<var>request</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>r</var> be null.
       <li>
        If <var>request</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①④">Request</a></code> object, then: 
        <ol>
         <li>Set <var>r</var> to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request⑥">request</a>.
         <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method③">method</a> is not `<code>GET</code>` and <var>options</var>.<var>ignoreMethod</var> is false, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⑥">promise</a> resolved with false.
        </ol>
       <li>
        Else if <var>request</var> is a string, then: 
        <ol>
         <li>Set <var>r</var> to the associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request⑦">request</a> of the result of invoking the initial value of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⑤">Request</a></code> as constructor with <var>request</var> as its argument. If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⑤">throws</a> an exception, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⑦">promise</a> rejected with that exception.
        </ol>
       <li>Let <var>operations</var> be an empty array.
       <li>Let <var>o</var> be an empty object representing a <code class="idl"><a data-link-type="idl" href="#dictdef-cache-cachebatchoperation" id="ref-for-dictdef-cache-cachebatchoperation②">CacheBatchOperation</a></code> dictionary.
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type②">type</a></code> dictionary member of <var>o</var> to "delete".
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request②">request</a></code> dictionary member of <var>o</var> to a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⑥">Request</a></code> object associated with <var>r</var>.
       <li>Set the <code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-options" id="ref-for-dom-cachebatchoperation-options">options</a></code> dictionary member of <var>o</var> to <var>options</var>.
       <li>Add <var>o</var> to <var>operations</var>.
       <li>Let <var>resultPromise</var> be the result of running <a href="#batch-cache-operations-algorithm">Batch Cache Operations</a> passing <var>operations</var> as the argument.
       <li>
        Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by⑤">transforming</a> <var>resultPromise</var> with a fulfillment handler, when called with argument <var>responseArray</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⓪">in parallel</a>: 
        <ol>
         <li>If <var>responseArray</var> is not null, return true.
         <li>Else, return false.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-keys">
      <h4 class="heading settled" data-level="5.4.7" id="cache-keys"><span class="secno">5.4.7. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-keys-method" id="ref-for-cache-keys-method①">keys(request, options)</a></code></span><a class="self-link" href="#cache-keys"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="Cache" data-dfn-type="method" data-export data-lt="keys(request, options)|keys(request)|keys()" id="cache-keys-method"><code>keys(<var>request</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>promise</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⑧">promise</a>.
       <li>
        Run these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②①">in parallel</a>: 
        <ol>
         <li>Let <var>resultArray</var> be an empty array.
         <li>
          If the optional argument <var>request</var> is omitted, then: 
          <ol>
           <li>
            For each <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record⑨">fetching record</a> <var>entry</var> of its <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①④">request to response map</a>, in key insertion order: 
            <ol>
             <li>Add <var>entry</var>.[[key]] to <var>resultArray</var>.
            </ol>
          </ol>
         <li>
          Else: 
          <ol>
           <li>Let <var>r</var> be null.
           <li>
            If <var>request</var> is a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⑦">Request</a></code> object, then: 
            <ol>
             <li>Set <var>r</var> to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request⑧">request</a>.
             <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method④">method</a> is not `<code>GET</code>` and <var>options</var>.<var>ignoreMethod</var> is false, resolve <var>promise</var> with an empty array.
            </ol>
           <li>
            Else if <var>request</var> is a string, then: 
            <ol>
             <li>Set <var>r</var> to the associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request⑨">request</a> of the result of invoking the initial value of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⑧">Request</a></code> as constructor with <var>request</var> as its argument. If this <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⑥">throws</a> an exception, return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects④⑨">promise</a> rejected with that exception.
            </ol>
           <li>Let <var>requestResponseArray</var> be the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①⑨">Request</a></code> object that represents <var>r</var> and <var>options</var> as the arguments.
           <li>
            For each <var>requestResponse</var> in <var>requestResponseArray</var>: 
            <ol>
             <li>Add <var>requestResponse</var>[0] to <var>resultArray</var>.
            </ol>
          </ol>
         <li>Resolve <var>promise</var> with <var>resultArray</var>.
        </ol>
       <li>Return <var>promise</var>.
      </ol>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="5.5" id="cache-storage"><span class="secno">5.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-interface" id="ref-for-cache-storage-interface②">CacheStorage</a></code></span><a class="self-link" href="#cache-storage"></a></h3>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑦"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①②"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#cache-storage-interface" id="ref-for-cache-storage-interface③"><c- g>CacheStorage</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑨"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#cache-storage-match-method" id="ref-for-cache-storage-match-method"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑦"><c- n>RequestInfo</c-></a> <dfn class="idl-code" data-dfn-for="CacheStorage/match(request, options), CacheStorage/match(request)" data-dfn-type="argument" data-export id="dom-cachestorage-match-request-options-request"><code><c- g>request</c-></code><a class="self-link" href="#dom-cachestorage-match-request-options-request"></a></dfn>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions⑤"><c- n>CacheQueryOptions</c-></a> <dfn class="idl-code" data-dfn-for="CacheStorage/match(request, options), CacheStorage/match(request)" data-dfn-type="argument" data-export id="dom-cachestorage-match-request-options-options"><code><c- g>options</c-></code><a class="self-link" href="#dom-cachestorage-match-request-options-options"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②⓪"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑨"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-has-method" id="ref-for-cache-storage-has-method"><c- g>has</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑧"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="CacheStorage/has(cacheName)" data-dfn-type="argument" data-export id="dom-cachestorage-has-cachename-cachename"><code><c- g>cacheName</c-></code><a class="self-link" href="#dom-cachestorage-has-cachename-cachename"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#cache-interface" id="ref-for-cache-interface①④"><c- n>Cache</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-open-method" id="ref-for-cache-storage-open-method"><c- g>open</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑨"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="CacheStorage/open(cacheName)" data-dfn-type="argument" data-export id="dom-cachestorage-open-cachename-cachename"><code><c- g>cacheName</c-></code><a class="self-link" href="#dom-cachestorage-open-cachename-cachename"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②②"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⓪"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-delete-method" id="ref-for-cache-storage-delete-method"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②⓪"><c- b>DOMString</c-></a> <dfn class="idl-code" data-dfn-for="CacheStorage/delete(cacheName)" data-dfn-type="argument" data-export id="dom-cachestorage-delete-cachename-cachename"><code><c- g>cacheName</c-></code><a class="self-link" href="#dom-cachestorage-delete-cachename-cachename"></a></dfn>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②③"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②①"><c- b>DOMString</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-storage-keys-method" id="ref-for-cache-storage-keys-method"><c- g>keys</c-></a>();
};
</pre>
     <p class="note" role="note"><code class="idl"><a data-link-type="idl" href="#cache-storage-interface" id="ref-for-cache-storage-interface④">CacheStorage</a></code> interface is designed to largely conform to <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects" id="ref-for-sec-map-objects①">ECMAScript 6 Map objects</a> but entirely async, and with additional convenience methods. The methods, <code>clear</code>, <code>forEach</code>, <code>entries</code> and <code>values</code>, are intentionally excluded from the scope of the first version resorting to the ongoing discussion about the async iteration by TC39.</p>
     <p>The user agent <em class="rfc2119" title="MUST">must</em> create a <code class="idl"><a data-link-type="idl" href="#cache-storage-interface" id="ref-for-cache-storage-interface⑤">CacheStorage</a></code> object when a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/window-object.html#window" id="ref-for-window⑨">Window</a></code> object or a <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope" id="ref-for-workerglobalscope②">WorkerGlobalScope</a></code> object is created and associate it with that <dfn class="dfn-paneled" data-dfn-for="CacheStorage" data-dfn-type="dfn" data-noexport id="cachestorage-global-object">global object</dfn>.</p>
     <p>A <code><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="interface" data-export id="cache-storage-interface"><code>CacheStorage</code></dfn></code> object represents a <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map①">name to cache map</a> of its associated <a data-link-type="dfn" href="#cachestorage-global-object" id="ref-for-cachestorage-global-object">global object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑧">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②②">origin</a>. Multiple separate objects implementing the <code class="idl"><a data-link-type="idl" href="#cache-storage-interface" id="ref-for-cache-storage-interface⑥">CacheStorage</a></code> interface across documents and workers can all be associated with the same <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map②">name to cache map</a> simultaneously.</p>
     <section class="algorithm" data-algorithm="cache-storage-match">
      <h4 class="heading settled" data-level="5.5.1" id="cache-storage-match"><span class="secno">5.5.1. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-match-method" id="ref-for-cache-storage-match-method①">match(request, options)</a></code></span><a class="self-link" href="#cache-storage-match"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="method" data-export data-lt="match(request, options)|match(request)" id="cache-storage-match-method"><code>match(<var>request</var>, <var>options</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>
        If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachequeryoptions-cachename" id="ref-for-dom-cachequeryoptions-cachename">cacheName</a></code> is <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-present" id="ref-for-dfn-present①">present</a>, then: 
        <ol>
         <li>
          Return a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⓪">promise</a> <var>p</var> and run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②②">in parallel</a>: 
          <ol>
           <li>
            For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type⑦">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map③">name to cache map</a>, in key insertion order: 
            <ol>
             <li>
              If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachequeryoptions-cachename" id="ref-for-dom-cachequeryoptions-cachename①">cacheName</a></code> matches <var>entry</var>.[[key]], then: 
              <ol>
               <li>Resolve <var>p</var> with the result of running the algorithm specified in <code class="idl"><a data-link-type="idl" href="#cache-match-method" id="ref-for-cache-match-method②">match(request, options)</a></code> method of <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⑤">Cache</a></code> interface with <var>request</var> and <var>options</var> as the arguments (providing <var>entry</var>.[[value]] as thisArgument to the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist" id="ref-for-sec-ecmascript-function-objects-call-thisargument-argumentslist">[[Call]]</a> internal method of <code class="idl"><a data-link-type="idl" href="#cache-match-method" id="ref-for-cache-match-method③">match(request, options)</a></code>.)
               <li>Abort these steps.
              </ol>
            </ol>
           <li>Resolve <var>p</var> with undefined.
          </ol>
        </ol>
       <li>
        Else: 
        <ol>
         <li>Let <var>p</var> be a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤①">promise</a> resolved with undefined.
         <li>
          For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type⑧">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map④">name to cache map</a>, in key insertion order: 
          <ol>
           <li>
            Set <var>p</var> to the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by⑥">transforming</a> itself with a fulfillment handler that, when called with argument <var>v</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②③">in parallel</a>: 
            <ol>
             <li>If <var>v</var> is not undefined, return <var>v</var>.
             <li>Return the result of running the algorithm specified in <code class="idl"><a data-link-type="idl" href="#cache-match-method" id="ref-for-cache-match-method④">match(request, options)</a></code> method of <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⑥">Cache</a></code> interface with <var>request</var> and <var>options</var> as the arguments (providing <var>entry</var>.[[value]] as thisArgument to the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist" id="ref-for-sec-ecmascript-function-objects-call-thisargument-argumentslist①">[[Call]]</a> internal method of <code class="idl"><a data-link-type="idl" href="#cache-match-method" id="ref-for-cache-match-method⑤">match(request, options)</a></code>.)
            </ol>
          </ol>
         <li>Return <var>p</var>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-storage-has">
      <h4 class="heading settled" data-level="5.5.2" id="cache-storage-has"><span class="secno">5.5.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-has-method" id="ref-for-cache-storage-has-method①">has(cacheName)</a></code></span><a class="self-link" href="#cache-storage-has"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="method" data-export id="cache-storage-has-method"><code>has(<var>cacheName</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>
        Return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤②">promise</a> <var>p</var> resolved with the result of running the following substeps: 
        <ol>
         <li>
          For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type⑨">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map⑤">name to cache map</a>, in key insertion order: 
          <ol>
           <li>
            If <var>cacheName</var> matches <var>entry</var>.[[key]], then: 
            <ol>
             <li>Return true.
            </ol>
          </ol>
         <li>Return false.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-storage-open">
      <h4 class="heading settled" data-level="5.5.3" id="cache-storage-open"><span class="secno">5.5.3. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-open-method" id="ref-for-cache-storage-open-method①">open(cacheName)</a></code></span><a class="self-link" href="#cache-storage-open"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="method" data-export id="cache-storage-open-method"><code>open(<var>cacheName</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>p</var> be a new <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤③">promise</a>.
       <li>
        Run the following substeps: 
        <ol>
         <li>
          For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⓪">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map⑥">name to cache map</a>, in key insertion order: 
          <ol>
           <li>
            If <var>cacheName</var> matches <var>entry</var>.[[key]], then: 
            <ol>
             <li>Resolve <var>p</var> with a new <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⑦">Cache</a></code> object which is a copy of <var>entry</var>.[[value]].
             <li>Abort these steps.
            </ol>
          </ol>
         <li>Let <var>cache</var> be a new <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⑧">Cache</a></code> object.
         <li>Set a newly-created <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①①">Record</a> {[[key]]: <var>cacheName</var>, [[value]]: <var>cache</var>} to <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map⑦">name to cache map</a>. If this cache write operation failed due to exceeding the granted quota limit, reject <var>p</var> with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#quotaexceedederror" id="ref-for-quotaexceedederror">QuotaExceededError</a></code>" exception and abort these steps.
         <li>Resolve <var>p</var> with <var>cache</var>.
        </ol>
       <li>Return <var>p</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-storage-delete">
      <h4 class="heading settled" data-level="5.5.4" id="cache-storage-delete"><span class="secno">5.5.4. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-delete-method" id="ref-for-cache-storage-delete-method①">delete(cacheName)</a></code></span><a class="self-link" href="#cache-storage-delete"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="method" data-export id="cache-storage-delete-method"><code>delete(<var>cacheName</var>)</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <ol>
       <li>Let <var>p</var> be the result of running the algorithm specified in <code class="idl"><a data-link-type="idl" href="#cache-storage-has-method" id="ref-for-cache-storage-has-method②">has(cacheName)</a></code> method with <var>cacheName</var> as the argument.
       <li>
        Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by⑦">transforming</a> <var>p</var> with a fulfillment handler that, when called with argument <var>cacheExists</var>, performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②④">in parallel</a>: 
        <ol>
         <li>
          If <var>cacheExists</var> is true, then: 
          <ol>
           <li>Delete a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①②">Record</a> {[[key]], [[value]]} <var>entry</var> from its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map⑧">name to cache map</a> where <var>cacheName</var> matches entry.[[key]].
           <li>Return true.
           <li>Abort these steps.
          </ol>
          <p class="note" role="note">After this step, the existing DOM objects (i.e. the currently referenced Cache, Request, and Response objects) should remain functional.</p>
         <li>
          Else: 
          <ol>
           <li>Return false.
          </ol>
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="cache-storage-keys">
      <h4 class="heading settled" data-level="5.5.5" id="cache-storage-keys"><span class="secno">5.5.5. </span><span class="content"><code class="idl"><a data-link-type="idl" href="#cache-storage-keys-method" id="ref-for-cache-storage-keys-method①">keys()</a></code></span><a class="self-link" href="#cache-storage-keys"></a></h4>
      <p><dfn class="dfn-paneled idl-code" data-dfn-for="CacheStorage" data-dfn-type="method" data-export id="cache-storage-keys-method"><code>keys()</code></dfn> method <em class="rfc2119" title="MUST">must</em> run these steps:</p>
      <p class="note" role="note">The promise returned from this method resolves with the sequence of keys, cache names in DOMString, in insertion order.</p>
      <ol>
       <li>Let <var>resultArray</var> be an empty array.
       <li>
        Return a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤④">promise</a> <var>p</var> resolved with the result of running the following substeps: 
        <ol>
         <li>
          For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①③">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map⑨">name to cache map</a>, in key insertion order: 
          <ol>
           <li>Add <var>entry</var>.[[key]] to <var>resultArray</var>.
          </ol>
         <li>Return <var>resultArray</var>.
        </ol>
      </ol>
     </section>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="6" id="security-considerations"><span class="secno">6. </span><span class="content">Security Considerations</span><a class="self-link" href="#security-considerations"></a></h2>
    <section>
     <h3 class="heading settled" data-level="6.1" id="secure-context"><span class="secno">6.1. </span><span class="content">Secure Context</span><a class="self-link" href="#secure-context"></a></h3>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦④">Service workers</a> <em class="rfc2119" title="MUST">must</em> execute in <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context③">secure contexts</a>. <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⓪">Service worker clients</a> <em class="rfc2119" title="MUST">must</em> also be <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context④">secure contexts</a> to register a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④②">service worker registration</a>, to get access to the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④③">service worker registrations</a> and the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⑤">service workers</a>, to do messaging with the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⑥">service workers</a>, and to be manipulated by the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⑦">service workers</a>. This effectively means that <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⑧">service workers</a> and their <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③①">service worker clients</a> <em class="rfc2119" title="SHOULD">should</em> be hosted over HTTPS. A user agent <em class="rfc2119" title="MAY">may</em> allow <code>localhost</code>, <code>127.0.0.0/8</code>, and <code>::1/128</code> for development purpose. (Note that they may still be <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context⑤">secure contexts</a>.) The primary reason for this restriction is to protect users from the <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#threat-risks" id="ref-for-threat-risks">risks associated with insecure contexts</a>.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="6.2" id="content-security-policy"><span class="secno">6.2. </span><span class="content">Content Security Policy</span><a class="self-link" href="#content-security-policy"></a></h3>
     <p>Whenever a user agent invokes <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑦⑨">service worker</a> <var>serviceWorker</var>: </p>
     <ul>
      <li>If <var>serviceWorker</var>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource③">script resource</a> was delivered with a <code>Content-Security-Policy</code> HTTP header containing the value <var>policy</var>, the user agent <em class="rfc2119" title="MUST">must</em> <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/2/#enforce" id="ref-for-enforce">enforce</a> <var>policy</var> for <var>serviceWorker</var>.
      <li>If <var>serviceWorker</var>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource④">script resource</a> was delivered with a <code>Content-Security-Policy-Report-Only</code> HTTP header containing the value <var>policy</var>, the user agent <em class="rfc2119" title="MUST">must</em> <a data-link-type="dfn" href="https://w3c.github.io/webappsec-csp/2/#monitor" id="ref-for-monitor">monitor</a> <var>policy</var> for <var>serviceWorker</var>.
     </ul>
     <p></p>
     <p>The primary reason for this restriction is to mitigate a broad class of content injection vulnerabilities, such as cross-site scripting (XSS).</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="6.3" id="origin-relativity"><span class="secno">6.3. </span><span class="content">Origin Relativity</span><a class="self-link" href="#origin-relativity"></a></h3>
     <section>
      <h4 class="heading settled" data-level="6.3.1" id="origin-restriction"><span class="secno">6.3.1. </span><span class="content">Origin restriction</span><a class="self-link" href="#origin-restriction"></a></h4>
      <p><em>This section is non-normative.</em></p>
      <p>A <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⓪">Service worker</a> executes in the registering <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③②">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②③">origin</a>. One of the advanced concerns that major applications would encounter is whether they can be hosted from a CDN. By definition, these are servers in other places, often on other <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②④">origins</a>. Therefore, <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧①">service workers</a> cannot be hosted on CDNs. But they can include resources via <a href="#importscripts-method" id="ref-for-importscripts-method">importScripts()</a>. The reason for this restriction is that <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧②">service workers</a> create the opportunity for a bad actor to turn a bad day into a bad eternity.</p>
     </section>
     <section>
      <h4 class="heading settled" data-level="6.3.2" id="importscripts"><span class="secno">6.3.2. </span><span class="content"><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts" id="ref-for-dom-workerglobalscope-importscripts">importScripts(urls)</a></code></span><a class="self-link" href="#importscripts"></a></h4>
      <p>When the <dfn class="dfn-paneled idl-code" data-dfn-for="ServiceWorkerGlobalScope" data-dfn-type="method" data-export id="importscripts-method"><code>importScripts(<var>urls</var>)</code></dfn> method is called on a <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface⑧">ServiceWorkerGlobalScope</a></code> object, the user agent <em class="rfc2119" title="MUST">must</em> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#import-scripts-into-worker-global-scope" id="ref-for-import-scripts-into-worker-global-scope">import scripts into worker global scope</a>, given this <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface⑨">ServiceWorkerGlobalScope</a></code> object and <var>urls</var>, and with the following steps to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-perform-fetch" id="ref-for-fetching-scripts-perform-fetch">perform the fetch</a> given the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request">request</a> <var>request</var>:</p>
      <ol>
       <li>Let <var>serviceWorker</var> be <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⑥">global object</a>’s <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⑧">service worker</a>.
       <li>
        If <var>serviceWorker</var>’s <a href="#dfn-imported-scripts-updated-flag" id="ref-for-dfn-imported-scripts-updated-flag">imported scripts updated flag</a> is unset, then: 
        <ol>
         <li>Let <var>response</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch⑦">fetching</a> <var>request</var>.
         <li>
          If <var>response</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#unsafe-response" id="ref-for-unsafe-response">unsafe response</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-type" id="ref-for-concept-response-type①">type</a> is not "<code>error</code>", and <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-status" id="ref-for-concept-response-status">status</a> is an <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#ok-status" id="ref-for-ok-status①">ok status</a>, then: 
          <ol>
           <li>If there exists a corresponding Record <var>record</var> for <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url⑦">url</a> in <var>serviceWorker</var>’s <a href="#dfn-script-resource-map" id="ref-for-dfn-script-resource-map">script resource map</a>, set <var>record</var>.[[value]] to <var>response</var>.
           <li>Else, set a newly-created Record {[[key]]: <var>url</var>, [[value]]: <var>response</var>} to <var>serviceWorker</var>’s <a href="#dfn-script-resource-map" id="ref-for-dfn-script-resource-map①">script resource map</a>.
          </ol>
         <li>Return <var>response</var>. 
        </ol>
       <li>
        Else: 
        <ol>
         <li>If there exists a corresponding Record <var>record</var> for <var>url</var> in <var>serviceWorker</var>’s <a href="#dfn-script-resource-map" id="ref-for-dfn-script-resource-map②">script resource map</a>, return <var>record</var>.[[value]].
         <li>Else, return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error②">network error</a>.
        </ol>
      </ol>
     </section>
    </section>
    <section>
     <h3 class="heading settled" data-level="6.4" id="cross-origin-resources"><span class="secno">6.4. </span><span class="content">Cross-Origin Resources and CORS</span><a class="self-link" href="#cross-origin-resources"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p>Applications tend to cache items that come from a CDN or other <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⑤">origin</a>. It is possible to request many of them directly using <code>&lt;script></code>, <code>&lt;img></code>, <code>&lt;video></code> and <code>&lt;link></code> elements. It would be hugely limiting if this sort of runtime collaboration broke when offline. Similarly, it is possible to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch⑧">fetch</a> many sorts of off-<a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⑥">origin</a> resources when appropriate CORS headers are set.</p>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧③">Service workers</a> enable this by allowing <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface①⑨">Caches</a></code> to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch⑨">fetch</a> and cache off-origin items. Some restrictions apply, however. First, unlike same-origin resources which are managed in the <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface②⓪">Cache</a></code> as <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①③">Response</a></code> objects whose corresponding <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response④">responses</a> are <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-filtered-response-basic" id="ref-for-concept-filtered-response-basic">basic filtered response</a>, the objects stored are <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①④">Response</a></code> objects whose corresponding <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response⑤">responses</a> are either <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors" id="ref-for-concept-filtered-response-cors">CORS filtered responses</a> or <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque" id="ref-for-concept-filtered-response-opaque">opaque filtered responses</a>. They can be passed to <code class="idl"><a data-link-type="idl" href="#fetch-event-respondwith-method" id="ref-for-fetch-event-respondwith-method③">event.respondWith(r)</a></code> method in the same manner as the <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⑤">Response</a></code> objects whose corresponding <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response⑥">responses</a> are <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-filtered-response-basic" id="ref-for-concept-filtered-response-basic①">basic filtered responses</a>, but cannot be meaningfully created programmatically. These limitations are necessary to preserve the security invariants of the platform. Allowing <code class="idl"><a data-link-type="idl" href="#cache-interface" id="ref-for-cache-interface②①">Caches</a></code> to store them allows applications to avoid re-architecting in most cases.</p>
    </section>
    <section>
     <h3 class="heading settled" data-level="6.5" id="implementer-concerns"><span class="secno">6.5. </span><span class="content">Implementer Concerns</span><a class="self-link" href="#implementer-concerns"></a></h3>
     <p><em>This section is non-normative.</em></p>
     <p>The implementers are encouraged to note: </p>
     <ul>
      <li>Plug-ins should not load via <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧④">service workers</a>. As plug-ins may get their security origins from their own urls, the embedding <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⑤">service worker</a> cannot handle it. For this reason, the <a href="#on-fetch-request-algorithm">Handle Fetch</a> algorithm makes the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#potential-navigation-or-subresource-request" id="ref-for-potential-navigation-or-subresource-request">potential-navigation-or-subresource request</a> (whose context is either <code>&lt;embed></code> or <code>&lt;object></code>) immediately fallback to the network without dispatching <a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event⑤">fetch</a> event.
      <li>Some of the legacy networking stack code may need to be carefully audited to understand the ramifications of interactions with <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⑥">service workers</a>.
     </ul>
     <p></p>
    </section>
    <section>
     <h3 class="heading settled" data-level="6.6" id="privacy"><span class="secno">6.6. </span><span class="content">Privacy</span><a class="self-link" href="#privacy"></a></h3>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⑦">Service workers</a> introduce new persistent storage features including <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map⑤">scope to registration map</a> (for <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④④">service worker registrations</a> and their <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⑧">service workers</a>), <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⑤">request to response map</a> and <a href="#dfn-name-to-cache-map" id="ref-for-dfn-name-to-cache-map①⓪">name to cache map</a> (for caches), and <a href="#dfn-script-resource-map" id="ref-for-dfn-script-resource-map③">script resource map</a> (for script resources). In order to protect users from any potential <a data-link-type="biblio" href="#biblio-unsanctioned-tracking">unsanctioned tracking</a> threat, these persistent storages <em class="rfc2119" title="SHOULD">should</em> be cleared when users intend to clear them and <em class="rfc2119" title="SHOULD">should</em> maintain and interoperate with existing user controls e.g. purging all existing persistent storages.</p>
    </section>
   </section>
   <section>
    <h2 class="heading settled" data-level="7" id="storage-considerations"><span class="secno">7. </span><span class="content">Storage Considerations</span><a class="self-link" href="#storage-considerations"></a></h2>
    <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑧⑨">Service workers</a> <em class="rfc2119" title="SHOULD">should</em> take a dependency on <a data-link-type="biblio" href="#biblio-quota-api">Quota Management API</a> that <a href="http://www.w3.org/TR/quota-api/#extensions-to-the-serviceworkerglobalscope-interface">extends the ServiceWorkerGlobalScope</a> with the event listeners <code class="idl"><a data-link-type="idl" href="http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onbeforeevicted" id="ref-for-widl-ServiceWorkerGlobalScope-onbeforeevicted">onbeforeevicted</a></code> and <code class="idl"><a data-link-type="idl" href="http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onevicted" id="ref-for-widl-ServiceWorkerGlobalScope-onevicted">onevicted</a></code> to detect a storage pressure and give pre-eviction information to the application.</p>
    <p>The cache write operations in <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⓪">service workers</a> when failed due to exceeding the granted quota limit <em class="rfc2119" title="SHOULD">should</em> throw "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#quotaexceedederror" id="ref-for-quotaexceedederror①">QuotaExceededError</a></code>" exception.</p>
    <section>
     <h2 class="heading settled" data-level="8" id="extensibility"><span class="secno">8. </span><span class="content">Extensibility</span><a class="self-link" href="#extensibility"></a></h2>
     <p><a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨①">Service workers</a> are extensible from other specifications.</p>
     <section>
      <h3 class="heading settled" data-level="8.1" id="extension-to-service-worker-registration"><span class="secno">8.1. </span><span class="content">Define API bound to Service Worker Registration</span><a class="self-link" href="#extension-to-service-worker-registration"></a></h3>
      <p>Specifications <em class="rfc2119" title="MAY">may</em> define an API tied to a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⑤">service worker registration</a> by using <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-partial-interface" id="ref-for-dfn-partial-interface">partial interface</a> definition to the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①③">ServiceWorkerRegistration</a></code> interface where it <em class="rfc2119" title="MAY">may</em> define the specification specific attributes and methods:</p>
<pre class="example idl highlight def" data-no-idl id="example-e75a31ac"><a class="self-link" href="#example-e75a31ac"></a><c- b>partial</c-> <c- b>interface</c-> <c- g>ServiceWorkerRegistration</c-> {
  // e.g. define an API namespace
  <c- b>readonly</c-> <c- b>attribute</c-> <c- n>APISpaceType</c-> <c- g>APISpace</c->;
  // e.g. define a method
  <c- b>Promise</c->&lt;<c- n>T</c->> <c- g>methodName</c->(/* list of arguments */);
};
</pre>
     </section>
     <section>
      <h3 class="heading settled" data-level="8.2" id="extension-to-extendable-event"><span class="secno">8.2. </span><span class="content">Define Functional Event</span><a class="self-link" href="#extension-to-extendable-event"></a></h3>
      <p>Specifications <em class="rfc2119" title="MAY">may</em> define a <a href="#dfn-functional-events" id="ref-for-dfn-functional-events④">functional event</a> by extending <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface①②">ExtendableEvent</a></code> interface:</p>
<pre class="example idl highlight def" data-no-idl id="example-85e5c3c4"><a class="self-link" href="#example-85e5c3c4"></a>// e.g. define FunctionalEvent interface
<c- b>interface</c-> <c- g>FunctionalEvent</c-> : <c- n>ExtendableEvent</c-> {
  // add a functional event’s own attributes and methods
};
</pre>
     </section>
     <section>
      <h3 class="heading settled" data-level="8.3" id="extension-to-service-worker-global-scope"><span class="secno">8.3. </span><span class="content">Define Event Handler</span><a class="self-link" href="#extension-to-service-worker-global-scope"></a></h3>
      <p>Specifications <em class="rfc2119" title="MAY">may</em> define an event handler attribute for the corresponding <a href="#dfn-functional-events" id="ref-for-dfn-functional-events⑤">functional event</a> using <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-partial-interface" id="ref-for-dfn-partial-interface①">partial interface</a> definition to the <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①⓪">ServiceWorkerGlobalScope</a></code> interface:</p>
<pre class="example idl highlight def" data-no-idl id="example-80342678"><a class="self-link" href="#example-80342678"></a><c- b>partial</c-> <c- b>interface</c-> <c- g>ServiceWorkerGlobalScope</c-> {
  <c- b>attribute</c-> <c- n>EventHandler</c-> <c- g>on</c-><em><c- g>functionalevent</c-></em>;
};
</pre>
     </section>
     <section>
      <h3 class="heading settled" data-level="8.4" id="request-functional-event-dispatch"><span class="secno">8.4. </span><span class="content">Request Functional Event Dispatch</span><a class="self-link" href="#request-functional-event-dispatch"></a></h3>
      <p>To request a <a href="#dfn-functional-events" id="ref-for-dfn-functional-events⑥">functional event</a> dispatch to a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨②">service worker</a>, specifications <em class="rfc2119" title="MAY">may</em> invoke <a href="#handle-functional-event-algorithm">Handle Functional Event</a> algorithm with its <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⑥">service worker registration</a> <var>registration</var> and the algorithm <var>callbackSteps</var> as the arguments.</p>
      <p>Specifications <em class="rfc2119" title="MAY">may</em> define an algorithm <var>callbackSteps</var> where the corresponding <a href="#dfn-functional-events" id="ref-for-dfn-functional-events⑦">functional event</a> can be created and fired with specification specific objects. The algorithm is passed <var>globalObject</var> (a <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①①">ServiceWorkerGlobalScope</a></code> object) at which it <em class="rfc2119" title="MAY">may</em> fire its <a href="#dfn-functional-events" id="ref-for-dfn-functional-events⑧">functional events</a>. This algorithm is called on a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task⑤">task</a> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task⑨">queued</a> by <a href="#handle-functional-event-algorithm">Handle Functional Event</a> algorithm.</p>
      <p class="note" role="note">See an <a href="https://notifications.spec.whatwg.org/#activating-a-notification">example</a> hook defined in <a data-link-type="biblio" href="#biblio-notifications">Notifications API</a>.</p>
     </section>
    </section>
    <section>
     <h2 class="heading settled" id="algorithms"><span class="content">Appendix A: Algorithms</span><a class="self-link" href="#algorithms"></a></h2>
     <p>The following definitions are the user agent’s internal data structures used throughout the specification.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-scope-to-registration-map">scope to registration map</dfn> is a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①④">List</a> of the <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⑤">Record</a> {[[key]], [[value]]} where [[key]] is a string that represents a <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①⓪">scope url</a> and [[value]] is a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⑦">service worker registration</a>.</p>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job">job</dfn> is an abstraction of one of register, update, and unregister request for a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⑧">service worker registration</a>.</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-type">job type</dfn>, which is one of <em>register</em>, <em>update</em>, and <em>unregister</em>.</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job①">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-scope-url">scope url</dfn> (a <a data-link-type="dfn">URL</a>).</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job②">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-script-url">script url</dfn> (a <a data-link-type="dfn">URL</a>).</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job③">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-worker-type">worker type</dfn> ("<code>classic</code>" or "<code>module</code>").</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job④">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-client">client</dfn> (a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③③">service worker client</a>). It is initially null.</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job⑤">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="job promise" data-noexport id="dfn-job-promise">promise</dfn> (a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⑤">promise</a>). It is initially null.</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job⑥">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-list-of-equivalent-jobs">list of equivalent jobs</dfn> (a list of <a href="#dfn-job" id="ref-for-dfn-job⑦">jobs</a>). It is initially the empty list.</p>
     <p>A <a href="#dfn-job" id="ref-for-dfn-job⑧">job</a> has a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-force-bypass-cache-flag">force bypass cache flag</dfn> It is initially unset.</p>
     <p>Two <a href="#dfn-job" id="ref-for-dfn-job⑨">jobs</a> are <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-equivalent">equivalent</dfn> when their <a href="#dfn-job-type" id="ref-for-dfn-job-type">job type</a> is the same and: </p>
     <ul>
      <li>For <em>register</em> and <em>update</em> <a href="#dfn-job" id="ref-for-dfn-job①⓪">jobs</a>, both their <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url">scope url</a> and the <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url">script url</a> are the same.
      <li>For <em>unregister</em> <a href="#dfn-job" id="ref-for-dfn-job①①">jobs</a>, their <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url①">scope url</a> is the same.
     </ul>
     <p></p>
     <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="dfn-job-queue">job queue</dfn> is a thread safe queue used to synchronize the set of concurrent <a href="#dfn-job" id="ref-for-dfn-job①②">jobs</a>. The <a href="#dfn-job-queue" id="ref-for-dfn-job-queue">job queue</a> contains <a href="#dfn-job" id="ref-for-dfn-job①③">jobs</a> as its elements. The <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①">job queue</a> <em class="rfc2119" title="SHOULD">should</em> satisfy the general properties of FIFO queue. A user agent <em class="rfc2119" title="MUST">must</em> maintain a separate <a href="#dfn-job-queue" id="ref-for-dfn-job-queue②">job queue</a> for each <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration④⑨">service worker registration</a> keyed by its <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①①">scope url</a>. A <a href="#dfn-job-queue" id="ref-for-dfn-job-queue③">job queue</a> is initially empty. Unless stated otherwise, the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue④">job queue</a> referenced from the algorithm steps is a <a href="#dfn-job-queue" id="ref-for-dfn-job-queue⑤">job queue</a> for the <a href="#dfn-job" id="ref-for-dfn-job①④">job</a>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url②">scope url</a>.</p>
     <section class="algorithm" data-algorithm="create-job-algorithm">
      <h3 class="heading settled" id="create-job-algorithm"><span class="content">Create Job</span><a class="self-link" href="#create-job-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>jobType</var>, a <a href="#dfn-job-type" id="ref-for-dfn-job-type①">job type</a>
       <dd><var>scopeURL</var>, a <a data-link-type="dfn">URL</a>
       <dd><var>scriptURL</var>, a <a data-link-type="dfn">URL</a>
       <dd><var>promise</var>, a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⑥">promise</a>
       <dd><var>client</var>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③④">service worker client</a>
       <dt>Output
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job①⑤">job</a>
      </dl>
      <ol>
       <li>Let <var>job</var> be a new <a href="#dfn-job" id="ref-for-dfn-job①⑥">job</a>.
       <li>Set <var>job</var>’s <a href="#dfn-job-type" id="ref-for-dfn-job-type②">job type</a> to <var>jobType</var>.
       <li>Set <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url③">scope url</a> to <var>scopeURL</var>.
       <li>Set <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url①">script url</a> to <var>scriptURL</var>.
       <li>Set <var>job</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise">promise</a> to <var>promise</var>.
       <li>Set <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client">client</a> to <var>client</var>.
       <li>Return <var>job</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="schedule-job-algorithm">
      <h3 class="heading settled" id="schedule-job-algorithm"><span class="content">Schedule Job</span><a class="self-link" href="#schedule-job-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job①⑦">job</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>
        If the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue⑥">job queue</a> is empty, then: 
        <ol>
         <li>Push <var>job</var> to the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue⑦">job queue</a> and invoke <a href="#run-job-algorithm">Run Job</a>.
        </ol>
       <li>
        Else: 
        <ol>
         <li>Let <var>lastJob</var> be the element at the back of the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue⑧">job queue</a>.
         <li>If <var>job</var> is <a href="#dfn-job-equivalent" id="ref-for-dfn-job-equivalent">equivalent</a> to <var>lastJob</var> and <var>lastJob</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise①">promise</a> has not settled, append <var>job</var> to <var>lastJob</var>’s <a href="#dfn-job-list-of-equivalent-jobs" id="ref-for-dfn-job-list-of-equivalent-jobs">list of equivalent jobs</a>.
         <li>Else, push <var>job</var> to the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue⑨">job queue</a>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="run-job-algorithm">
      <h3 class="heading settled" id="run-job-algorithm"><span class="content">Run Job</span><a class="self-link" href="#run-job-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd>none
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions">Assert</a>: the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①⓪">job queue</a> is not empty.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⓪">Queue a task</a> to run these steps: 
        <ol>
         <li>Let <var>job</var> be the element in the front of the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①①">job queue</a>.
         <li>If <var>job</var>’s <a href="#dfn-job-type" id="ref-for-dfn-job-type③">job type</a> is <em>register</em>, run <a href="#register-algorithm">Register</a> with <var>job</var> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⑤">in parallel</a>.
         <li>
          Else if <var>job</var>’s <a href="#dfn-job-type" id="ref-for-dfn-job-type④">job type</a> is <em>update</em>, run <a href="#update-algorithm">Update</a> with <var>job</var> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⑥">in parallel</a>. 
          <p class="note" role="note">For a register job and an update job, the user agent delays queuing a task for running the job until after the document initiated the job has been dispatched <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/indices.html#event-domcontentloaded" id="ref-for-event-domcontentloaded">DOMContentLoaded</a></code> event.</p>
         <li>Else if <var>job</var>’s <a href="#dfn-job-type" id="ref-for-dfn-job-type⑤">job type</a> is <em>unregister</em>, run <a href="#unregister-algorithm">Unregister</a> with <var>job</var> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⑦">in parallel</a>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="finish-job-algorithm">
      <h3 class="heading settled" id="finish-job-algorithm"><span class="content">Finish Job</span><a class="self-link" href="#finish-job-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job①⑧">job</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions①">Assert</a>: the top element in the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①②">job queue</a> is <var>job</var>.
       <li>Pop the top element from the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①③">job queue</a>.
       <li>If the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①④">job queue</a> is not empty, invoke <a href="#run-job-algorithm">Run Job</a> with the top element of the <a href="#dfn-job-queue" id="ref-for-dfn-job-queue①⑤">job queue</a>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="resolve-job-promise-algorithm">
      <h3 class="heading settled" id="resolve-job-promise-algorithm"><span class="content">Resolve Job Promise</span><a class="self-link" href="#resolve-job-promise-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job①⑨">job</a>
       <dd><var>value</var>, any
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>If <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client①">client</a> is not null, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①①">queue a task</a> to resolve <var>job</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise②">promise</a> with <var>value</var> on <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client②">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑤">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source①">DOM manipulation task source</a> as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source⑤">task source</a>.
       <li>
        For each <var>equivalentJob</var> in <var>job</var>’s <a href="#dfn-job-list-of-equivalent-jobs" id="ref-for-dfn-job-list-of-equivalent-jobs①">list of equivalent jobs</a>: 
        <ol>
         <li>If <var>equivalentJob</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client③">client</a> is not null, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①②">queue a task</a> to resolve <var>equivalentJob</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise③">promise</a> with <var>value</var> on <var>equivalentJob</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client④">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑥">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source②">DOM manipulation task source</a> as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source⑥">task source</a>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="reject-job-promise-algorithm">
      <h3 class="heading settled" id="reject-job-promise-algorithm"><span class="content">Reject Job Promise</span><a class="self-link" href="#reject-job-promise-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job②⓪">job</a>
       <dd><var>reason</var>, an <a data-link-type="dfn" href="https://www.w3.org/TR/WebIDL/#dfn-exception" id="ref-for-dfn-exception">exception</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>If <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client⑤">client</a> is not null, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①③">queue a task</a> to reject <var>job</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise④">promise</a> with <var>reason</var> on <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client⑥">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑦">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source③">DOM manipulation task source</a> as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source⑦">task source</a>.
       <li>
        For each <var>equivalentJob</var> in <var>job</var>’s <a href="#dfn-job-list-of-equivalent-jobs" id="ref-for-dfn-job-list-of-equivalent-jobs②">list of equivalent jobs</a>: 
        <ol>
         <li>If <var>equivalentJob</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client⑦">client</a> is not null, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①④">queue a task</a> to reject <var>equivalentJob</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise⑤">promise</a> with <var>reason</var> on <var>equivalentJob</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client⑧">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑧">responsible event loop</a> using the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source④">DOM manipulation task source</a> as the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source⑧">task source</a>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="register-algorithm">
      <h3 class="heading settled" id="register-algorithm"><span class="content">Register</span><a class="self-link" href="#register-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job②①">job</a>
       <dt>Output
       <dd><var>promise</var>, a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⑦">promise</a>
      </dl>
      <ol>
       <li>
        If the result of running <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#is-origin-trustworthy" id="ref-for-is-origin-trustworthy">Is origin potentially trustworthy</a> with the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⑦">origin</a> of <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url②">script url</a> as the argument is <code>Not Trusted</code>, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror②">SecurityError</a></code>" exception.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>
        If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⑧">origin</a> of <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url③">script url</a> is not <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client⑨">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2②⑨">origin</a>, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror③">SecurityError</a></code>" exception.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>
        If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③⓪">origin</a> of <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url④">scope url</a> is not <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client①⓪">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③①">origin</a>, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror④">SecurityError</a></code>" exception.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Let <var>registration</var> be the result of running the <a href="#get-registration-algorithm">Get Registration</a> algorithm passing <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url⑤">scope url</a> as the argument.
       <li>
        If <var>registration</var> is not null, then: 
        <ol>
         <li>If <var>registration</var>’s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag①">uninstalling flag</a> is set, unset it.
         <li>Let <var>newestWorker</var> be the result of running the <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as the argument.
         <li>
          If <var>newestWorker</var> is not null and <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url④">script url</a> <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals">equals</a> <var>newestWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url②">script url</a> with the <em>exclude fragments flag</em> set, then: 
          <ol>
           <li>Invoke <a href="#resolve-job-promise-algorithm">Resolve Job Promise</a> with <var>job</var> and the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①④">ServiceWorkerRegistration</a></code> object which represents <var>registration</var>.
           <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
          </ol>
        </ol>
       <li>
        Else: 
        <ol>
         <li>Invoke <a href="#set-registration-algorithm">Set Registration</a> algorithm passing <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url⑥">scope url</a> as its argument.
        </ol>
       <li>Invoke <a href="#update-algorithm">Update</a> algorithm passing <var>job</var> as the argument.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="update-algorithm">
      <h3 class="heading settled" id="update-algorithm"><span class="content">Update</span><a class="self-link" href="#update-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job②②">job</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>Let <var>registration</var> be the result of running the <a href="#get-registration-algorithm">Get Registration</a> algorithm passing <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url⑦">scope url</a> as the argument.
       <li>
        If <var>registration</var> is null or <var>registration</var>’s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag②">uninstalling flag</a> is set, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a <code>TypeError</code>.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as the argument.
       <li>
        If <var>job</var>’s <a href="#dfn-job-type" id="ref-for-dfn-job-type⑥">job type</a> is <em>update</em>, and <var>newestWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url③">script url</a> does not <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals①">equal</a> <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url⑤">script url</a> with the <em>exclude fragments flag</em> set, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a <code>TypeError</code>.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>
        Switching on <var>job</var>’s <a data-link-type="dfn" href="#dfn-job-worker-type" id="ref-for-dfn-job-worker-type①">worker type</a>, run these substeps with the following options: 
        <dl>
         <dt><em>"<code>classic</code>"</em>
         <dd>
          <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script" id="ref-for-fetch-a-classic-worker-script">Fetch a classic worker script</a> given <var>job</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer③">serialized</a> <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url⑥">script url</a>, <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client①①">client</a>, and "<code>serviceworker</code>".</p>
         <dt><em>"<code>module</code>"</em>
         <dd>
          <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-worker-script-tree" id="ref-for-fetch-a-module-worker-script-tree">Fetch a module worker script tree</a> given <var>job</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer④">serialized</a> <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url⑦">script url</a>, <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client①②">client</a>, "<code>serviceworker</code>", "<code>omit</code>", and the to-be-created <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object⑨">environment settings object</a> for this service worker.</p>
        </dl>
        <p>To <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-perform-fetch" id="ref-for-fetching-scripts-perform-fetch①">perform the fetch</a> given <var>request</var>, run the following steps if the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-top-level" id="ref-for-fetching-scripts-is-top-level">is top-level</a> flag is set:</p>
        <ol>
         <li>
          Append `<code>Service-Worker</code>`/`<code>script</code>` to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-header-list" id="ref-for-concept-request-header-list">header list</a>. 
          <p class="note" role="note">See the definition of the Service-Worker header in Appendix B: Extended HTTP headers.</p>
         <li>Set <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#skip-service-worker-flag" id="ref-for-skip-service-worker-flag">skip service worker flag</a> and <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-redirect-mode" id="ref-for-concept-request-redirect-mode">redirect mode</a> to "<code>error</code>".
         <li>
          If <var>newestWorker</var> is not null and <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time">last update check time</a> is not null, then: 
          <ol>
           <li>If the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time①">last update check time</a> is greater than 86400, or <em>force bypass cache flag</em> is set, set <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-cache-mode" id="ref-for-concept-request-cache-mode">cache mode</a> to "<code>reload</code>".
          </ol>
          <p class="note" role="note">Even if the cache mode is not set to "reload", the user agent obeys Cache-Control header’s max-age value in the network layer to determine if it should bypass the browser cache.</p>
         <li><a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch①⓪">Fetch</a> <var>request</var>, and asynchronously wait to run the remaining steps as part of fetch’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#process-response" id="ref-for-process-response①">process response</a> for the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response③">response</a> <var>response</var>.
         <li>
          <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type" id="ref-for-concept-header-extract-mime-type">Extract a MIME type</a> from the <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list②">header list</a>. If this MIME type (ignoring parameters) is not one of <code>text/javascript</code>, <code>application/x-javascript</code>, and <code>application/javascript</code>, then: 
          <ol>
           <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑤">SecurityError</a></code>" exception.
           <li>Asynchronously complete these steps with a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error③">network error</a>.
          </ol>
         <li>
          Let <var>serviceWorkerAllowed</var> be the result of <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-parse" id="ref-for-concept-header-parse">parsing</a> `<code>Service-Worker-Allowed</code>` in <var>response</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list③">header list</a>. 
          <p class="note" role="note">See the definition of the Service-Worker-Allowed header in Appendix B: Extended HTTP headers.</p>
         <li>
          If <var>serviceWorkerAllowed</var> is failure, then: 
          <ol>
           <li>Asynchronously complete these steps with a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error④">network error</a>.
          </ol>
         <li>Let <var>scopeURL</var> be <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①②">scope url</a>.
         <li>Let <var>maxScopeString</var> be null.
         <li>
          If <var>serviceWorkerAllowed</var> is null, then: 
          <ol>
           <li>Set <var>maxScopeString</var> to "<code>/</code>" concatenated with the strings, except the last string that denotes the script’s file name, in <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url⑧">script url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path" id="ref-for-concept-url-path②">path</a> (including empty strings), separated from each other by "<code>/</code>".
          </ol>
         <li>
          Else: 
          <ol>
           <li>Let <var>maxScope</var> be the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser⑦">parsing</a> <var>serviceWorkerAllowed</var> with <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url⑨">script url</a>.
           <li>Set <var>maxScopeString</var> to "<code>/</code>" concatenated with the strings in <var>maxScope</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path" id="ref-for-concept-url-path③">path</a> (including empty strings), separated from each other by "<code>/</code>".
          </ol>
         <li>Let <var>scopeString</var> be "<code>/</code>" concatenated with the strings in <var>scopeURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-path" id="ref-for-concept-url-path④">path</a> (including empty strings), separated from each other by "<code>/</code>".
         <li>If <var>scopeString</var> starts with <var>maxScopeString</var>, do nothing.
         <li>
          Else: 
          <ol>
           <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑥">SecurityError</a></code>" exception.
           <li>Asynchronously complete these steps with a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error⑤">network error</a>.
          </ol>
         <li>
          If <var>response</var>’s <a href="https://github.com/whatwg/fetch/issues/376">cache state</a> is not "<code>local</code>", set <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time②">last update check time</a> to the current time. 
          <p class="issue" id="issue-b27ba9d2"><a class="self-link" href="#issue-b27ba9d2"></a>The response’s cache state concept had been removed from fetch. The fetch issue <a href="https://github.com/whatwg/fetch/issues/376">#376</a> tracks the request to restore the concept or add some similar way to check this state.</p>
         <li>Return true.
        </ol>
        <p>If the algorithm asynchronously completes with null, then: </p>
        <ol>
         <li>
          <p>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a <code>TypeError</code>.</p>
          <p class="note" role="note">This will do nothing if <a href="#reject-job-promise-algorithm">Reject Job Promise</a> was previously invoked with a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑦">SecurityError</a></code>" exception.</p>
         <li>If <var>newestWorker</var> is null, invoke <a href="#clear-registration-algorithm">Clear Registration</a> algorithm passing <var>registration</var> as its argument.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
        <p></p>
        <p>Else, continue the rest of these steps after the algorithm’s asynchronous completion, with <var>script</var> being the asynchronous completion value.</p>
       <li>
        If <var>newestWorker</var> is not null, <var>newestWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url④">script url</a> <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals②">equals</a> <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url①⓪">script url</a> with the <em>exclude fragments flag</em> set, and <var>script</var> is a byte-for-byte match with <var>newestWorker</var>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource⑤">script resource</a>, then: 
        <ol>
         <li>Invoke <a href="#resolve-job-promise-algorithm">Resolve Job Promise</a> with <var>job</var> and the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⑤">ServiceWorkerRegistration</a></code> object which represents <var>registration</var>.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>
        Else: 
        <ol>
         <li>Let <var>worker</var> be a new <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨③">service worker</a>.
         <li>Generate a unique opaque string and set <var>worker</var>’s <a href="#dfn-service-worker-id" id="ref-for-dfn-service-worker-id">id</a> to the value.
         <li>Set <var>worker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url⑤">script url</a> to <var>job</var>’s <a href="#dfn-job-script-url" id="ref-for-dfn-job-script-url①①">script url</a>, <var>worker</var>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource⑥">script resource</a> to <var>script</var>, and <var>worker</var>’s <a href="#dfn-type" id="ref-for-dfn-type②">type</a> to <var>job</var>’s <a data-link-type="dfn" href="#dfn-job-worker-type" id="ref-for-dfn-job-worker-type②">worker type</a>.
         <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>worker</var> as the argument.
         <li>
          If an uncaught runtime script error occurs during the above step, then: 
          <ol>
           <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a <code>TypeError</code>.
           <li>If <var>newestWorker</var> is null, invoke <a href="#clear-registration-algorithm">Clear Registration</a> algorithm passing <var>registration</var> as its argument.
           <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
          </ol>
        </ol>
       <li>Invoke <a href="#installation-algorithm">Install</a> algorithm with <var>job</var>, <var>worker</var>, and <var>registration</var> as its arguments.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="soft-update-algorithm">
      <h3 class="heading settled" id="soft-update-algorithm"><span class="content">Soft Update</span><a class="self-link" href="#soft-update-algorithm"></a></h3>
      <p>The user agent <em class="rfc2119" title="MAY">may</em> call this as often as it likes to check for updates.</p>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⓪">service worker registration</a>
       <dd><em>force bypass cache flag</em>, an optional flag unset by default
       <p class="note" role="note">Implementers may use the <em>force bypass cache flag</em> to aid debugging (e.g. invocations from developer tools), and other specifications that extend service workers may also use the flag on their own needs.</p>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.
       <li>If <var>newestWorker</var> is null, abort these steps.
       <li>Let <var>job</var> be the result of running <a href="#create-job-algorithm">Create Job</a> with <em>update</em>, <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①③">scope url</a>, <var>newestWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url⑥">script url</a>, null, and null.
       <li>Set <var>job</var>’s <a data-link-type="dfn" href="#dfn-job-worker-type" id="ref-for-dfn-job-worker-type③">worker type</a> to <var>newestWorker</var>’s <a data-link-type="dfn" href="#dfn-type" id="ref-for-dfn-type①">type</a>.
       <li>Set <var>job</var>’s <a href="#dfn-job-force-bypass-cache-flag" id="ref-for-dfn-job-force-bypass-cache-flag">force bypass cache flag</a> if its <em>force bypass cache flag</em> is set.
       <li>Invoke <a href="#schedule-job-algorithm">Schedule Job</a> with <var>job</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="installation-algorithm">
      <h3 class="heading settled" id="installation-algorithm"><span class="content">Install</span><a class="self-link" href="#installation-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job②③">job</a>
       <dd><var>worker</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨④">service worker</a>
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤①">service worker registration</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>Let <var>installFailed</var> be false.
       <li>Let <var>newestWorker</var> be the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> algorithm passing <var>registration</var> as its argument.
       <li>Let <var>redundantWorker</var> be null.
       <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>installing</code>" and <var>worker</var> as the arguments.
       <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①①">installing worker</a> and <em>installing</em> as the arguments.
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions②">Assert</a>: <var>job</var>’s <a href="#dfn-job-promise" id="ref-for-dfn-job-promise⑥">promise</a> is not null.
       <li>Invoke <a href="#resolve-job-promise-algorithm">Resolve Job Promise</a> with <var>job</var> and the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⑥">ServiceWorkerRegistration</a></code> object which represents <var>registration</var>.
       <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑤">Queue a task</a> to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event" id="ref-for-fire-a-simple-event">fire a simple event</a> named <code>updatefound</code> at all the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⑦">ServiceWorkerRegistration</a></code> objects for all the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⑤">service worker clients</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url⑥">creation url</a> <a href="#scope-match-algorithm">matches</a> <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①④">scope url</a> and all the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⑤">service workers</a> whose <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①⓪">containing service worker registration</a> is <var>registration</var>.
       <li>Let <var>installingWorker</var> be <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①②">installing worker</a>.
       <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>installingWorker</var> as the argument.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑥">Queue a task</a> <var>task</var> to run the following substeps: 
        <ol>
         <li>Create a <a data-link-type="dfn">trusted event</a> <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface①③">ExtendableEvent</a></code> interface, with the event type <code><a href="#service-worker-global-scope-install-event" id="ref-for-service-worker-global-scope-install-event⑤">install</a></code>, which does not bubble and is not cancelable.
         <li><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch⑤">Dispatch</a> <var>e</var> at <var>installingWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①⓪">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⑦">global object</a> <var>globalObject</var>.
         <li>
          <em>WaitForAsynchronousExtensions</em>: Run the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⑧">in parallel</a>: 
          <ol>
           <li>Wait until <var>e</var>’s <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag④">extensions allowed flag</a> is unset.
           <li>If the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all" id="ref-for-waiting-for-all②">waiting for all</a> of <var>e</var>’s <a data-link-type="dfn" href="#dfn-extend-lifetime-promises" id="ref-for-dfn-extend-lifetime-promises⑧">extend lifetime promises</a> rejected, set <var>installFailed</var> to true.
          </ol>
        </ol>
       <p>If <var>task</var> is discarded or the script has been aborted by the <a href="#terminate-service-worker-algorithm">termination</a> of <var>installingWorker</var>, set <var>installFailed</var> to true.</p>
       <li>Wait for <var>task</var> to have executed or been discarded.
       <li>Wait for the step labeled <em>WaitForAsynchronousExtensions</em> to complete.
       <li>
        If <var>installFailed</var> is true, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①③">installing worker</a>.
         <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>installing</code>" and null as the arguments.
         <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
         <li>If <var>newestWorker</var> is null, invoke <a href="#clear-registration-algorithm">Clear Registration</a> algorithm passing <var>registration</var> as its argument.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Set <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①④">installing worker</a>’s <a href="#dfn-imported-scripts-updated-flag" id="ref-for-dfn-imported-scripts-updated-flag①">imported scripts updated flag</a>.
       <li>
        If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker⑨">waiting worker</a> is not null, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⓪">waiting worker</a>.
         <li><a href="#terminate-service-worker-algorithm">Terminate</a> <var>redundantWorker</var>.
         <li>The user agent <em class="rfc2119" title="MAY">may</em> abort in-flight requests triggered by <var>redundantWorker</var>.
        </ol>
       <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>waiting</code>" and <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⑤">installing worker</a> as the arguments.
       <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>installing</code>" and null as the arguments.
       <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①①">waiting worker</a> and <em>installed</em> as the arguments.
       <li>If <var>redundantWorker</var> is not null, run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
       <li>
        If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①②">waiting worker</a>’s <a href="#dfn-skip-waiting-flag" id="ref-for-dfn-skip-waiting-flag②">skip waiting flag</a> is set, then: 
        <ol>
         <li>Run <a href="#activation-algorithm">Activate</a> algorithm passing <var>registration</var> as the argument.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var>.
       <li>Wait for all the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task⑥">tasks</a> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑦">queued</a> by <a href="#update-state-algorithm">Update Worker State</a> invoked in this algorithm have executed.
       <li>Wait until no <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⑥">service worker client</a> is <a href="#dfn-use" id="ref-for-dfn-use③">using</a> <var>registration</var> or <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①③">waiting worker</a>’s <a href="#dfn-skip-waiting-flag" id="ref-for-dfn-skip-waiting-flag③">skip waiting flag</a> is set.
       <li>If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①④">waiting worker</a> <var>waitingWorker</var> is not null and <var>waitingWorker</var>’s <a href="#dfn-skip-waiting-flag" id="ref-for-dfn-skip-waiting-flag④">skip waiting flag</a> is not set, invoke <a href="#activation-algorithm">Activate</a> algorithm with <var>registration</var> as its argument.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="activation-algorithm">
      <h3 class="heading settled" id="activation-algorithm"><span class="content">Activate</span><a class="self-link" href="#activation-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤②">service worker registration</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⑤">waiting worker</a> is null, abort these steps.
       <li>Let <var>redundantWorker</var> be null.
       <li>
        If <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②③">active worker</a> is not null, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②④">active worker</a>.
         <li>Wait for <var>redundantWorker</var> to finish handling any in-progress requests. 
         <li><a href="#terminate-service-worker-algorithm">Terminate</a> <var>redundantWorker</var>.
        </ol>
       <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>active</code>" and <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⑥">waiting worker</a> as the arguments.
       <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>waiting</code>" and null as the arguments.
       <li>
        Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⑤">active worker</a> and <em>activating</em> as the arguments. 
        <p class="note" role="note">Once an active worker is activating, neither a runtime script error nor a force termination of the active worker prevents the active worker from getting activated.</p>
       <li>If <var>redundantWorker</var> is not null, run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
       <li>
        For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⑦">service worker client</a> <var>client</var> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url⑦">creation url</a> <a href="#scope-match-algorithm">matches</a> <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①⑤">scope url</a>: 
        <ol>
         <li>If <var>client</var> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client⑦">window client</a>, unassociate <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document" id="ref-for-responsible-document③">responsible document</a> from its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/offline.html#application-cache" id="ref-for-application-cache①">application cache</a>, if it has one.
         <li>Else if <var>client</var> is a <a href="#dfn-sharedworker-client" id="ref-for-dfn-sharedworker-client②">shared worker client</a>, unassociate <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⑧">global object</a> from its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/offline.html#application-cache" id="ref-for-application-cache②">application cache</a>, if it has one.
        </ol>
        <p class="note" role="note">Resources will now use the service worker registration instead of the existing application cache.</p>
       <li>
        For each <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⑧">service worker client</a> <var>client</var> who is <a href="#dfn-use" id="ref-for-dfn-use④">using</a> <var>registration</var>: 
        <ol>
         <li>Set <var>client</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⑥">active worker</a> to <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⑦">active worker</a>.
         <li>Invoke <a href="#notify-controller-change-algorithm">Notify Controller Change</a> algorithm with <var>client</var> as the argument.
        </ol>
       <li>Let <var>activeWorker</var> be <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⑧">active worker</a>.
       <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>activeWorker</var> as the argument.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑧">Queue a task</a> <var>task</var> to run the following substeps: 
        <ol>
         <li>Create a <a data-link-type="dfn">trusted event</a> <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#extendable-event-interface" id="ref-for-extendable-event-interface①④">ExtendableEvent</a></code> interface, with the event type <code><a href="#service-worker-global-scope-activate-event" id="ref-for-service-worker-global-scope-activate-event⑤">activate</a></code>, which does not bubble and is not cancelable.
         <li><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch⑥">Dispatch</a> <var>e</var> at <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①①">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global①⑨">global object</a>.
         <li><em>WaitForAsynchronousExtensions</em>: Wait, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel②⑨">in parallel</a>, until <var>e</var>’s <a data-link-type="dfn" href="#extensions-allowed-flag" id="ref-for-extensions-allowed-flag⑤">extensions allowed flag</a> is unset.
        </ol>
       <li>Wait for <var>task</var> to have executed or been discarded, or the script to have been aborted by the <a href="#terminate-service-worker-algorithm">termination</a> of <var>activeWorker</var>.
       <li>Wait for the step labeled <em>WaitForAsynchronousExtensions</em> to complete.
       <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker②⑨">active worker</a> and <em>activated</em> as the arguments.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="run-service-worker-algorithm">
      <h3 class="heading settled" id="run-service-worker-algorithm"><span class="content">Run Service Worker</span><a class="self-link" href="#run-service-worker-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>serviceWorker</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⑥">service worker</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Let <var>script</var> be <var>serviceWorker</var>’s <a data-link-type="dfn" href="#dfn-script-resource" id="ref-for-dfn-script-resource⑦">script resource</a>.
       <li>Assert: <var>script</var> is not null.
       <li>If <var>serviceWorker</var> is already running, abort these steps.
       <li>Create a separate parallel execution environment (i.e. a separate thread or process or equivalent construct), and run the rest of these steps in that context.
       <li>
        Call the JavaScript <a href="https://tc39.github.io/ecma262/#sec-initializehostdefinedrealm">InitializeHostDefinedRealm()</a> abstract operation with the following customizations: 
        <ul>
         <li>For the global object, create a new <code class="idl"><a data-link-type="idl" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface①②">ServiceWorkerGlobalScope</a></code> object. Let <var>workerGlobalScope</var> be the created object.
         <li>Let <var>realmExecutionContext</var> be the created <a href="https://tc39.github.io/ecma262/#sec-execution-contexts">JavaScript execution context</a>.
        </ul>
       <li>Let <var>workerEventLoop</var> be a newly created <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop⑤">event loop</a>.
       <li>Let <var>workerGlobalScope</var> be <var>realmExecutionContext</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global" id="ref-for-concept-realm-global">global object</a>.
       <li>
        Let <var>settingsObject</var> be a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①②">environment settings object</a> whose algorithms are defined as follows: 
        <dl>
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#realm-execution-context" id="ref-for-realm-execution-context">realm execution context</a>
         <dd>Return <var>realmExecutionContext</var>.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②⓪">global object</a>
         <dd>Return <var>workerGlobalScope</var>.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop⑨">responsible event loop</a>
         <dd>Return <var>workerEventLoop</var>.
         <dt>The <a data-link-type="dfn">referrer source</a>
         <dd>Return <var>serviceWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url⑦">script url</a>.
         <p class="issue" id="issue-b739bfcf"><a class="self-link" href="#issue-b739bfcf"></a>Remove this definition after sorting out the referencing sites.</p>
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-url-character-encoding" id="ref-for-api-url-character-encoding">API URL character encoding</a>
         <dd>Return UTF-8.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url" id="ref-for-api-base-url⑤">API base URL</a>
         <dd>Return <var>serviceWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url⑧">script url</a>.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③②">origin</a>
         <dd>Return its registering <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client③⑨">service worker client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③③">origin</a>.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url" id="ref-for-creation-url⑧">creation URL</a>
         <dd>Return <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-url" id="ref-for-concept-workerglobalscope-url">url</a>.
         <dt>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#https-state" id="ref-for-https-state">HTTPS state</a>
         <dd>Return <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-https-state" id="ref-for-concept-workerglobalscope-https-state">HTTPS state</a>.
        </dl>
       <li>Set <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-url" id="ref-for-concept-workerglobalscope-url①">url</a> to <var>serviceWorker</var>’s <a href="#dfn-script-url" id="ref-for-dfn-script-url⑨">script url</a>.
       <li>Set <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-https-state" id="ref-for-concept-workerglobalscope-https-state①">HTTPS state</a> to <var>serviceWorker</var>’s <a data-link-type="dfn" href="#dfn-script-resource" id="ref-for-dfn-script-resource①">script resource</a>’s <a href="#dfn-https-state" id="ref-for-dfn-https-state">HTTPS state</a>.
       <li>Set <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-type" id="ref-for-concept-workerglobalscope-type">type</a> to <var>serviceWorker</var>’s <a href="#dfn-type" id="ref-for-dfn-type③">type</a>.
       <li>Create a new <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/workers.html#workerlocation" id="ref-for-workerlocation">WorkerLocation</a></code> object and associate it with <var>workerGlobalScope</var>.
       <li>If <var>serviceWorker</var> is an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③⓪">active worker</a>, and there are any <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task⑦">tasks</a> queued in <var>serviceWorker</var>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①①">containing service worker registration</a>’s <a href="#dfn-service-worker-registration-task-queue" id="ref-for-dfn-service-worker-registration-task-queue②">task queues</a>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task①⑨">queue</a> them to <var>serviceWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop⑥">event loop</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue③">task queues</a> in the same order using their original <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source⑨">task sources</a>.
       <li>
        If <var>script</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#classic-script" id="ref-for-classic-script">classic script</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#run-a-classic-script" id="ref-for-run-a-classic-script">run the classic script</a> <var>script</var>. Otherwise, it is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#module-script" id="ref-for-module-script">module script</a>; <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#run-a-module-script" id="ref-for-run-a-module-script">run the module script</a> <var>script</var>. 
        <p class="note" role="note">In addition to the usual possibilities of returning a value or failing due to an exception, this could be prematurely aborted by the <a data-link-type="dfn">kill a worker</a> or <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/workers.html#terminate-a-worker" id="ref-for-terminate-a-worker">terminate a worker</a> algorithms.</p>
       <li>
        If <var>script</var>’s <a href="#dfn-has-ever-been-evaluated-flag" id="ref-for-dfn-has-ever-been-evaluated-flag">has ever been evaluated flag</a> is unset, then: 
        <ol>
         <li>
          Set <var>workerGlobalScope</var>’s associated <a href="#dfn-service-worker-global-scope-service-worker" id="ref-for-dfn-service-worker-global-scope-service-worker①⑨">service worker</a>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle">set of event types to handle</a> to the set of event types created from <var>settingsObject</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②①">global object</a>’s associated list of <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-listener" id="ref-for-concept-event-listener①">event listeners</a>' event types. 
          <p class="note" role="note">If the global object’s associated list of event listeners does not have any event listener added at this moment, the service worker’s set of event types to handle is set to an empty set. The user agents are encouraged to show a warning that the event listeners must be added on the very first evaluation of the worker script.</p>
         <li>Set <var>script</var>’s <a href="#dfn-has-ever-been-evaluated-flag" id="ref-for-dfn-has-ever-been-evaluated-flag①">has ever been evaluated flag</a>.
        </ol>
       <li>Run the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①⓪">responsible event loop</a> specified by <var>settingsObject</var> until it is destroyed.
       <li>Empty <var>workerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#list-of-active-timers" id="ref-for-list-of-active-timers">list of active timers</a>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="terminate-service-worker-algorithm">
      <h3 class="heading settled" id="terminate-service-worker-algorithm"><span class="content">Terminate Service Worker</span><a class="self-link" href="#terminate-service-worker-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>serviceWorker</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⑦">service worker</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>If <var>serviceWorker</var> is not running, abort these steps.
       <li>Let <var>serviceWorkerGlobalScope</var> be <var>serviceWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①③">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②②">global object</a>.
       <li>Set <var>serviceWorkerGlobalScope</var>’s closing flag to true.
       <li>
        If there are any <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task⑧">tasks</a>, whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source①⓪">task source</a> is either the <a href="#dfn-handle-fetch-task-source" id="ref-for-dfn-handle-fetch-task-source①">handle fetch task source</a> or the <a href="#dfn-handle-functional-event-task-source" id="ref-for-dfn-handle-functional-event-task-source①">handle functional event task source</a>, queued in <var>serviceWorkerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop⑦">event loop</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue④">task queues</a>, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②⓪">queue</a> them to <var>serviceWorker</var>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①②">containing service worker registration</a>’s corresponding <a href="#dfn-service-worker-registration-task-queue" id="ref-for-dfn-service-worker-registration-task-queue③">task queues</a> in the same order using their original <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source①①">task sources</a>, and discard all the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task⑨">tasks</a> (including <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①⓪">tasks</a> whose <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source" id="ref-for-task-source①②">task source</a> is neither the <a href="#dfn-handle-fetch-task-source" id="ref-for-dfn-handle-fetch-task-source②">handle fetch task source</a> nor the <a href="#dfn-handle-functional-event-task-source" id="ref-for-dfn-handle-functional-event-task-source②">handle functional event task source</a>) from <var>serviceWorkerGlobalScope</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop⑧">event loop</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue" id="ref-for-task-queue⑤">task queues</a> without processing them. 
        <p class="note" role="note">This effectively means that the fetch events and the other functional events such as push events are backed up by the registration’s task queues while the other tasks including message events are discarded.</p>
       <li>Abort the script currently running in <var>serviceWorker</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="on-fetch-request-algorithm">
      <h3 class="heading settled" id="on-fetch-request-algorithm"><span class="content">Handle Fetch</span><a class="self-link" href="#on-fetch-request-algorithm"></a></h3>
      <p>The <a href="#on-fetch-request-algorithm">Handle Fetch</a> algorithm is the entry point for the <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch①①">fetch</a> handling handed to the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⑧">service worker</a> context.</p>
      <dl>
       <dt>Input
       <dd><var>request</var>, a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request" id="ref-for-concept-request①">request</a>
       <dt>Output
       <dd><var>response</var>, a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response" id="ref-for-concept-response④">response</a>
      </dl>
      <ol data-link-for-hint="FetchEvent">
       <li>Let <var>handleFetchFailed</var> be false.
       <li>Let <var>respondWithEntered</var> be false.
       <li>Let <var>eventCanceled</var> be false.
       <li>Let <var>r</var> be a new <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②⓪">Request</a></code> object associated with <var>request</var>.
       <li>Let <var>headersObject</var> be <var>r</var>’s <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-headers" id="ref-for-dom-request-headers">headers</a></code> attribute value.
       <li>Set <var>headersObject</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-headers-guard" id="ref-for-concept-headers-guard④">guard</a> to <em>immutable</em>.
       <li>Let <var>response</var> be null.
       <li>Let <var>registration</var> be null.
       <li>Let <var>client</var> be the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④⓪">service worker client</a> that corresponds to <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client①">client</a>.
       <li>Assert: <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-destination" id="ref-for-concept-request-destination①">destination</a> is not "<code>serviceworker</code>".
       <li>
        If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#potential-navigation-or-subresource-request" id="ref-for-potential-navigation-or-subresource-request①">potential-navigation-or-subresource request</a>, then: 
        <ol>
         <li>Return null.
        </ol>
       <li>
        Else if <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request①">non-subresource request</a>, then: 
        <p class="note" role="note">If the non-subresource request is under the scope of a service worker registration, application cache is completely bypassed regardless of whether the non-subresource request uses the service worker registration.</p>
        <ol>
         <li>If <var>client</var> is not a <a data-link-type="dfn" href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context" id="ref-for-secure-context⑥">secure context</a>, return null.
         <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#navigation-request" id="ref-for-navigation-request">navigation request</a> and the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate" id="ref-for-navigate③">navigation</a> triggering it was initiated with a shift+reload or equivalent, return null.
         <li>Set <var>registration</var> to the result of running <a href="#scope-match-algorithm">Match Service Worker Registration</a> algorithm passing <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url⑧">url</a> as the argument.
         <li>If <var>registration</var> is null or <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③①">active worker</a> is null, return null.
         <li>Set <var>client</var>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker⑤">active worker</a> to <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③②">active worker</a>.
        </ol>
        <p class="note" role="note">From this point, the <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④①">service worker client</a> starts to <a href="#dfn-use" id="ref-for-dfn-use⑤">use</a> its <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker⑥">active worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①③">containing service worker registration</a>.</p>
       <li>
        Else if <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request" id="ref-for-subresource-request">subresource request</a>, then: 
        <ol>
         <li>If <var>client</var>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker⑦">active worker</a> is non-null, set <var>registration</var> to <var>client</var>’s <a href="#dfn-service-worker-client-active-worker" id="ref-for-dfn-service-worker-client-active-worker⑧">active worker</a>’s <a href="#dfn-containing-service-worker-registration" id="ref-for-dfn-containing-service-worker-registration①④">containing service worker registration</a>.
         <li>Else, return null.
        </ol>
       <li>Let <var>activeWorker</var> be <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③③">active worker</a>.
       <li>
        If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle①">set of event types to handle</a> does not contain <code>fetch</code>, return null. 
        <p class="note" role="note">To avoid unnecessary delays, the Handle Fetch enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.</p>
       <li>If <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state⑨">state</a> is <em>activating</em>, wait for <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state①⓪">state</a> to become <em>activated</em>.
       <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>activeWorker</var> as the argument.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②①">Queue a task</a> <var>task</var> to run the following substeps: 
        <ol>
         <li>Create a <a data-link-type="dfn">trusted event</a> <var>e</var> that uses the <code class="idl"><a data-link-type="idl" href="#fetch-event-interface" id="ref-for-fetch-event-interface④">FetchEvent</a></code> interface, with the event type <code><a href="#service-worker-global-scope-fetch-event" id="ref-for-service-worker-global-scope-fetch-event⑥">fetch</a></code>, which does not bubble.
         <li>Let the <a href="#fetch-event-request-attribute" id="ref-for-fetch-event-request-attribute③">request</a> attribute of <var>e</var> be initialized to <var>r</var>.
         <li>Let the <a href="#fetch-event-clientid-attribute" id="ref-for-fetch-event-clientid-attribute③">clientId</a> attribute of <var>e</var> be initialized to <var>client</var>’s <a href="#dfn-service-worker-client-id" id="ref-for-dfn-service-worker-client-id②">id</a> if <var>request</var> is not a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request②">non-subresource request</a>, and to null otherwise.
         <li>Let the <a href="#fetch-event-isreload-attribute" id="ref-for-fetch-event-isreload-attribute③">isReload</a> attribute of <var>e</var> be initialized to <code>true</code> if <var>request</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-client" id="ref-for-concept-request-client②">client</a> is a <a href="#dfn-window-client" id="ref-for-dfn-window-client⑧">window client</a> and the event was dispatched with the user’s intention for the page reload, and <code>false</code> otherwise.
         <li><a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-event-dispatch" id="ref-for-concept-event-dispatch⑦">Dispatch</a> <var>e</var> at <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①④">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②③">global object</a>.
         <li>If <var>e</var>’s <a href="#respond-with-entered-flag" id="ref-for-respond-with-entered-flag②">respond-with entered flag</a> is set, set <var>respondWithEntered</var> to true.
         <li>
          If <var>e</var>’s <a href="#wait-to-respond-flag" id="ref-for-wait-to-respond-flag②">wait to respond flag</a> is set, then: 
          <ol>
           <li>Wait until <var>e</var>’s <a href="#wait-to-respond-flag" id="ref-for-wait-to-respond-flag③">wait to respond flag</a> is unset.
           <li>If <var>e</var>’s <a href="#respond-with-error-flag" id="ref-for-respond-with-error-flag④">respond-with error flag</a> is set, set <var>handleFetchFailed</var> to true.
           <li>Else, set <var>response</var> to <var>e</var>’s <a data-link-type="dfn" href="#fetchevent-potential-response" id="ref-for-fetchevent-potential-response①">potential response</a>.
          </ol>
         <li>If <var>e</var>’s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#canceled-flag" id="ref-for-canceled-flag">canceled flag</a> is set, set <var>eventCanceled</var> to true.
        </ol>
        <p>If <var>task</var> is discarded or the script has been aborted by the <a href="#terminate-service-worker-algorithm">termination</a> of <var>activeWorker</var>, set <var>handleFetchFailed</var> to true.</p>
        <p>The <var>task</var> <em class="rfc2119" title="MUST">must</em> use <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop⑨">event loop</a> and the <a href="#dfn-handle-fetch-task-source" id="ref-for-dfn-handle-fetch-task-source③">handle fetch task source</a>.</p>
       <li>Wait for <var>task</var> to have executed or been discarded.
       <li>
        If <var>respondWithEntered</var> is false, then: 
        <ol>
         <li>If <var>eventCanceled</var> is true, return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error⑥">network error</a> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③⓪">in parallel</a>.
         <li>Else, return null and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③①">in parallel</a>.
         <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request③">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request" id="ref-for-subresource-request①">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time③">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>.
         <li>Abort these steps.
        </ol>
       <li>
        If <var>handleFetchFailed</var> is true, then: 
        <ol>
         <li>Return a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-network-error" id="ref-for-concept-network-error⑦">network error</a> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③②">in parallel</a>.
         <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request④">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request" id="ref-for-subresource-request②">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time④">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>.
        </ol>
       <li>
        Else: 
        <ol>
         <li>Return <var>response</var> and continue running these substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③③">in parallel</a>.
         <li>If <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#non-subresource-request" id="ref-for-non-subresource-request⑤">non-subresource request</a>, or <var>request</var> is a <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#subresource-request" id="ref-for-subresource-request③">subresource request</a> and the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time⑤">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>.
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="handle-functional-event-algorithm">
      <h3 class="heading settled" id="handle-functional-event-algorithm"><span class="content">Handle Functional Event</span><a class="self-link" href="#handle-functional-event-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤③">service worker registration</a>
       <dd><var>callbackSteps</var>, an algorithm
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions③">Assert</a>: a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⑥">Record</a> with the [[value]] equals to <var>registration</var> is contained in <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map⑥">scope to registration map</a>.
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions④">Assert</a>: <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③④">active worker</a> is not null.
       <li>Let <var>activeWorker</var> be <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③⑤">active worker</a>.
       <li>
        If <var>activeWorker</var>’s <a href="#dfn-set-of-event-types-to-handle" id="ref-for-dfn-set-of-event-types-to-handle②">set of event types to handle</a> does not contain the event type for this functional event, return. 
        <p class="note" role="note">To avoid unnecessary delays, the Handle Functional Event enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.</p>
       <li>If <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state①①">state</a> is <em>activating</em>, wait for <var>activeWorker</var>’s <a href="#dfn-state" id="ref-for-dfn-state①②">state</a> to become <em>activated</em>.
       <li>Invoke <a href="#run-service-worker-algorithm">Run Service Worker</a> algorithm with <var>activeWorker</var> as the argument.
       <li>
        <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②②">Queue a task</a> <var>task</var> to invoke <var>callbackSteps</var> with <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object" id="ref-for-environment-settings-object①⑤">environment settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global" id="ref-for-concept-settings-object-global②④">global object</a> as its argument. 
        <p>The <var>task</var> <em class="rfc2119" title="MUST">must</em> use <var>activeWorker</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop" id="ref-for-event-loop①⓪">event loop</a> and the <a href="#dfn-handle-functional-event-task-source" id="ref-for-dfn-handle-functional-event-task-source③">handle functional event task source</a>.</p>
       <li>Wait for <var>task</var> to have executed or been discarded.
       <li>If the time difference in seconds calculated by the current time minus <var>registration</var>’s <a href="#dfn-last-update-check-time" id="ref-for-dfn-last-update-check-time⑥">last update check time</a> is greater than 86400, invoke <a href="#soft-update-algorithm">Soft Update</a> algorithm with <var>registration</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="on-client-unload-algorithm">
      <h3 class="heading settled" id="on-client-unload-algorithm"><span class="content">Handle Service Worker Client Unload</span><a class="self-link" href="#on-client-unload-algorithm"></a></h3>
      <p>The user agent <em class="rfc2119" title="MUST">must</em> run these steps when a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④②">service worker client</a> unloads by <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#unload-a-document" id="ref-for-unload-a-document">unloading</a>, <a data-link-type="dfn">being killed</a>, or <a href="#terminate-service-worker-algorithm">terminating</a>.</p>
      <dl>
       <dt>Input
       <dd><var>client</var>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④③">service worker client</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>registration</var> be the <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤④">service worker registration</a> <a href="#dfn-use" id="ref-for-dfn-use⑥">used</a> by <var>client</var>.
       <li>If <var>registration</var> is null, abort these steps.
       <li>If any other <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④④">service worker client</a> is <a href="#dfn-use" id="ref-for-dfn-use⑦">using</a> <var>registration</var>, abort these steps.
       <li>If <var>registration</var>’s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag③">uninstalling flag</a> is set, invoke <a href="#clear-registration-algorithm">Clear Registration</a> algorithm passing <var>registration</var> as its argument and abort these steps.
       <li>If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⑦">waiting worker</a> is not null, run <a href="#activation-algorithm">Activate</a> algorithm with <var>registration</var> as the argument.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="on-user-agent-shutdown-algorithm">
      <h3 class="heading settled" id="on-user-agent-shutdown-algorithm"><span class="content">Handle User Agent Shutdown</span><a class="self-link" href="#on-user-agent-shutdown-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd>None
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>
        For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⑦">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map⑦">scope to registration map</a>: 
        <ol>
         <li>Let <var>registration</var> be <var>entry</var>.[[value]].
         <li>
          If <var>registration</var>’s <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker②">installing worker</a> <var>installingWorker</var> is not null, then: 
          <ol>
           <li>If the result of running <a href="#get-newest-worker-algorithm">Get Newest Worker</a> with <var>registration</var> is <var>installingWorker</var>, invoke <a href="#clear-registration-algorithm">Clear Registration</a> with <var>registration</var> and continue to the next iteration of the loop.
           <li>Else, set <var>registration</var>’s <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker③">installing worker</a> to null.
          </ol>
         <li>
          If <var>registration</var>’s <a data-link-type="dfn" href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①">waiting worker</a> is not null, run the following substep <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③④">in parallel</a>: 
          <ol>
           <li>Invoke <a href="#activation-algorithm">Activate</a> with <var>registration</var>.
          </ol>
        </ol>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="unregister-algorithm">
      <h3 class="heading settled" id="unregister-algorithm"><span class="content">Unregister</span><a class="self-link" href="#unregister-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>job</var>, a <a href="#dfn-job" id="ref-for-dfn-job②④">job</a>
       <dt>Output
       <dd>none
      </dl>
      <ol>
       <li>
        If the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③④">origin</a> of <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url⑧">scope url</a> is not <var>job</var>’s <a href="#dfn-job-client" id="ref-for-dfn-job-client①③">client</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2" id="ref-for-origin-2③⑤">origin</a>, then: 
        <ol>
         <li>Invoke <a href="#reject-job-promise-algorithm">Reject Job Promise</a> with <var>job</var> and a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#securityerror" id="ref-for-securityerror⑧">SecurityError</a></code>" exception.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Let <var>registration</var> be the result of running <a href="#get-registration-algorithm">Get Registration</a> algorithm passing <var>job</var>’s <a href="#dfn-job-scope-url" id="ref-for-dfn-job-scope-url⑨">scope url</a> as the argument.
       <li>
        If <var>registration</var> is null, then: 
        <ol>
         <li>Invoke <a href="#resolve-job-promise-algorithm">Resolve Job Promise</a> with <var>job</var> and false.
         <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var> and abort these steps.
        </ol>
       <li>Set <var>registration</var>’s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag④">uninstalling flag</a>.
       <li>Invoke <a href="#resolve-job-promise-algorithm">Resolve Job Promise</a> with <var>job</var> and true.
       <li>
        If no <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④⑤">service worker client</a> is <a href="#dfn-use" id="ref-for-dfn-use⑧">using</a> <var>registration</var>, invoke <a href="#clear-registration-algorithm">Clear Registration</a> algorithm passing <var>registration</var> as its argument. 
        <p class="note" role="note">When the registration is being used for a client, the deletion of the registration is handled by the Handle Service Worker Client Unload algorithm.</p>
       <li>Invoke <a href="#finish-job-algorithm">Finish Job</a> with <var>job</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="set-registration-algorithm">
      <h3 class="heading settled" id="set-registration-algorithm"><span class="content">Set Registration</span><a class="self-link" href="#set-registration-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>scope</var>, a <a data-link-type="dfn">URL</a>
       <dt>Output
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⑤">service worker registration</a>
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>scopeString</var> be <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer⑤">serialized</a> <var>scope</var> with the <em>exclude fragment flag</em> set.
       <li>Let <var>registration</var> be a new <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⑥">service worker registration</a> whose <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①⑥">scope url</a> is set to <var>scope</var>.
       <li>Set a newly-created <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⑧">Record</a> {[[key]]: <var>scopeString</var>, [[value]]: <var>registration</var>} to <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map⑧">scope to registration map</a>.
       <li>Return <var>registration</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="clear-registration-algorithm">
      <h3 class="heading settled" id="clear-registration-algorithm"><span class="content">Clear Registration</span><a class="self-link" href="#clear-registration-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⑦">service worker registration</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>redundantWorker</var> be null.
       <li>
        If <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⑥">installing worker</a> is not null, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⑦">installing worker</a>.
         <li><a href="#terminate-service-worker-algorithm">Terminate</a> <var>redundantWorker</var>.
         <li>The user agent <em class="rfc2119" title="MAY">may</em> abort in-flight requests triggered by <var>redundantWorker</var>.
         <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>installing</code>" and null as the arguments.
         <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
        </ol>
       <li>
        If <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⑧">waiting worker</a> is not null, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker①⑨">waiting worker</a>.
         <li><a href="#terminate-service-worker-algorithm">Terminate</a> <var>redundantWorker</var>.
         <li>The user agent <em class="rfc2119" title="MAY">may</em> abort in-flight requests triggered by <var>redundantWorker</var>.
         <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>waiting</code>" and null as the arguments.
         <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
        </ol>
       <li>
        If <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③⑥">active worker</a> is not null, then: 
        <ol>
         <li>Set <var>redundantWorker</var> to <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③⑦">active worker</a>.
         <li><a href="#terminate-service-worker-algorithm">Terminate</a> <var>redundantWorker</var>.
         <li>The user agent <em class="rfc2119" title="MAY">may</em> abort in-flight requests triggered by <var>redundantWorker</var>.
         <li>Run the <a href="#update-registration-state-algorithm">Update Registration State</a> algorithm passing <var>registration</var>, "<code>active</code>" and null as the arguments.
         <li>Run the <a href="#update-state-algorithm">Update Worker State</a> algorithm passing <var>redundantWorker</var> and <em>redundant</em> as the arguments.
        </ol>
       <li>Delete a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type①⑨">Record</a> {[[key]], [[value]]} <var>entry</var> from <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map⑨">scope to registration map</a> where <var>registration</var>’s <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①⑦">scope url</a> is the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser⑧">parsing</a> <var>entry</var>.[[key]].
      </ol>
     </section>
     <section class="algorithm" data-algorithm="update-registration-state-algorithm">
      <h3 class="heading settled" id="update-registration-state-algorithm"><span class="content">Update Registration State</span><a class="self-link" href="#update-registration-state-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⑧">service worker registration</a>
       <dd><var>target</var>, a string (one of "<code>installing</code>", "<code>waiting</code>", and "<code>active</code>")
       <dd><var>source</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker⑨⑨">service worker</a> or null
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Let <var>registrationObjects</var> be an array containing all the <code class="idl"><a data-link-type="idl" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⑧">ServiceWorkerRegistration</a></code> objects associated with <var>registration</var>.
       <li>
        If <var>target</var> is "<code>installing</code>", then: 
        <ol>
         <li>Set <var>registration</var>’s <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker④">installing worker</a> to <var>source</var>.
         <li>
          For each <var>registrationObject</var> in <var>registrationObjects</var>: 
          <ol>
           <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②③">Queue a task</a> to set the <a href="#service-worker-registration-installing-attribute" id="ref-for-service-worker-registration-installing-attribute③">installing</a> attribute of <var>registrationObject</var> to the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②⑥">ServiceWorker</a></code> object that represents <var>registration</var>’s <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker⑤">installing worker</a>, or null if <var>registration</var>’s <a data-link-type="dfn" href="#dfn-installing-worker" id="ref-for-dfn-installing-worker⑥">installing worker</a> is null.
          </ol>
        </ol>
       <li>
        Else if <var>target</var> is "<code>waiting</code>", then: 
        <ol>
         <li>Set <var>registration</var>’s <a data-link-type="dfn" href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker②">waiting worker</a> to <var>source</var>.
         <li>
          For each <var>registrationObject</var> in <var>registrationObjects</var>: 
          <ol>
           <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②④">Queue a task</a> to set the <a href="#service-worker-registration-waiting-attribute" id="ref-for-service-worker-registration-waiting-attribute③">waiting</a> attribute of <var>registrationObject</var> to the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②⑦">ServiceWorker</a></code> object that represents <var>registration</var>’s <a data-link-type="dfn" href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker③">waiting worker</a>, or null if <var>registration</var>’s <a data-link-type="dfn" href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker④">waiting worker</a> is null.
          </ol>
        </ol>
       <li>
        Else if <var>target</var> is "<code>active</code>", then: 
        <ol>
         <li>Set <var>registration</var>’s <a data-link-type="dfn" href="#dfn-active-worker" id="ref-for-dfn-active-worker③⑧">active worker</a> to <var>source</var>.
         <li>
          For each <var>registrationObject</var> in <var>registrationObjects</var>: 
          <ol>
           <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②⑤">Queue a task</a> to set the <a href="#service-worker-registration-active-attribute" id="ref-for-service-worker-registration-active-attribute③">active</a> attribute of <var>registrationObject</var> to the <code class="idl"><a data-link-type="idl" href="#service-worker-interface" id="ref-for-service-worker-interface②⑧">ServiceWorker</a></code> object that represents <var>registration</var>’s <a data-link-type="dfn" href="#dfn-active-worker" id="ref-for-dfn-active-worker①">active worker</a>, or null if <var>registration</var>’s <a data-link-type="dfn" href="#dfn-active-worker" id="ref-for-dfn-active-worker②">active worker</a> is null.
          </ol>
        </ol>
        <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①①">task</a> <em class="rfc2119" title="MUST">must</em> use <var>registrationObject</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①①">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①①">responsible event loop</a> and the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source⑤">DOM manipulation task source</a>.</p>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="update-state-algorithm">
      <h3 class="heading settled" id="update-state-algorithm"><span class="content">Update Worker State</span><a class="self-link" href="#update-state-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>worker</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⓪">service worker</a>
       <dd><var>state</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪①">service worker</a>’s <a href="#dfn-state" id="ref-for-dfn-state①③">state</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li>Set <var>worker</var>’s <a href="#dfn-state" id="ref-for-dfn-state①④">state</a> to <var>state</var>.
       <li>Let <var>workerObjects</var> be an array containing all the <code><a href="#service-worker-interface" id="ref-for-service-worker-interface③②">ServiceWorker</a></code> objects associated with <var>worker</var>.
       <li>
        For each <var>workerObject</var> in <var>workerObjects</var>: 
        <ol>
         <li>
          <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②⑥">Queue a task</a> to run these substeps: 
          <ol>
           <li>
            Set the <a href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute⑤">state</a> attribute of <var>workerObject</var> to the value (in <code class="idl"><a data-link-type="idl" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum③">ServiceWorkerState</a></code> enumeration) corresponding to the first matching statement, switching on <var>worker</var>’s <a href="#dfn-state" id="ref-for-dfn-state①⑤">state</a>: 
            <dl>
             <dt><em>installing</em>
             <dd>
              "<code>installing</code>" 
              <p class="note" role="note">The <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪②">service worker</a> in this state is considered an <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⑧">installing worker</a>. During this state, <code><a href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method⑥">event.waitUntil(<var>f</var>)</a></code> can be called inside the <code><a href="#service-worker-global-scope-oninstall-attribute" id="ref-for-service-worker-global-scope-oninstall-attribute②">oninstall</a></code> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers⑧">event handler</a> to extend the life of the <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker①⑨">installing worker</a> until the passed <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⑧">promise</a> resolves successfully. This is primarily used to ensure that the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪③">service worker</a> is not active until all of the core caches are populated.</p>
             <dt><em>installed</em>
             <dd>
              "<code>installed</code>" 
              <p class="note" role="note">The <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪④">service worker</a> in this state is considered a <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker②⓪">waiting worker</a>.</p>
             <dt><em>activating</em>
             <dd>
              "<code>activating</code>" 
              <p class="note" role="note">The <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⑤">service worker</a> in this state is considered an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker③⑨">active worker</a>. During this state, <code><a href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method⑦">event.waitUntil(<var>f</var>)</a></code> can be called inside the <code><a href="#service-worker-global-scope-onactivate-attribute" id="ref-for-service-worker-global-scope-onactivate-attribute②">onactivate</a></code> <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers" id="ref-for-event-handlers⑨">event handler</a> to extend the life of the <a href="#dfn-active-worker" id="ref-for-dfn-active-worker④⓪">active worker</a> until the passed <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑤⑨">promise</a> resolves successfully. No <a href="#dfn-functional-events" id="ref-for-dfn-functional-events⑨">functional events</a> are dispatched until the state becomes <em>activated</em>.</p>
             <dt><em>activated</em>
             <dd>
              "<code>activated</code>" 
              <p class="note" role="note">The <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⑥">service worker</a> in this state is considered an <a href="#dfn-active-worker" id="ref-for-dfn-active-worker④①">active worker</a> ready to handle <a href="#dfn-functional-events" id="ref-for-dfn-functional-events①⓪">functional events</a>.</p>
             <dt><em>redundant</em>
             <dd>
              "<code>redundant</code>" 
              <p class="note" role="note">A new <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⑦">service worker</a> is replacing the current <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⑧">service worker</a>, or the current <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①⓪⑨">service worker</a> is being discarded due to an install failure.</p>
            </dl>
           <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event" id="ref-for-fire-a-simple-event①">Fire a simple event</a> named <code>statechange</code> at <var>workerObject</var>.
          </ol>
        </ol>
        <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①②">task</a> <em class="rfc2119" title="MUST">must</em> use <var>workerObject</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object" id="ref-for-relevant-settings-object①②">relevant settings object</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①②">responsible event loop</a> and the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source⑥">DOM manipulation task source</a>.</p>
      </ol>
     </section>
     <section class="algorithm" data-algorithm="notify-controller-change-algorithm">
      <h3 class="heading settled" id="notify-controller-change-algorithm"><span class="content">Notify Controller Change</span><a class="self-link" href="#notify-controller-change-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>client</var>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④⑥">service worker client</a>
       <dt>Output
       <dd>None
      </dl>
      <ol>
       <li><a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions" id="ref-for-sec-algorithm-conventions⑤">Assert</a>: <var>client</var> is not null.
       <li><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task" id="ref-for-queue-a-task②⑦">Queue a task</a> to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event" id="ref-for-fire-a-simple-event②">fire a simple event</a> named <code>controllerchange</code> at the <code><a href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①⑦">ServiceWorkerContainer</a></code> object <var>client</var> is <a href="#dfn-service-worker-container-interface-client" id="ref-for-dfn-service-worker-container-interface-client⑦">associated</a> with.
      </ol>
      <p>The <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task" id="ref-for-concept-task①③">task</a> <em class="rfc2119" title="MUST">must</em> use <var>client</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop" id="ref-for-responsible-event-loop①③">responsible event loop</a> and the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source" id="ref-for-dom-manipulation-task-source⑦">DOM manipulation task source</a>.</p>
     </section>
     <section class="algorithm" data-algorithm="scope-match-algorithm">
      <h3 class="heading settled" id="scope-match-algorithm"><span class="content">Match Service Worker Registration</span><a class="self-link" href="#scope-match-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>clientURL</var>, a <a data-link-type="dfn">URL</a>
       <dt>Output
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑤⑨">service worker registration</a>
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>clientURLString</var> be <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer⑥">serialized</a> <var>clientURL</var>.
       <li>Let <var>matchingScope</var> be the empty string.
       <li>
        Set <var>matchingScope</var> to the longest [[key]] in <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map①⓪">scope to registration map</a> which the value of <var>clientURLString</var> starts with, if it exists. 
        <p class="note" role="note">The URL string matching in this step is prefix-based rather than path-structural (e.g. a client URL string with "/prefix-of/resource.html" will match a registration for a scope with "/prefix").</p>
       <li>Let <var>parsedMatchingScope</var> be null.
       <li>If <var>matchingScope</var> is not the empty string, set <var>parsedMatchingScope</var> to the result of <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-parser" id="ref-for-concept-url-parser⑨">parsing</a> <var>matchingScope</var>.
       <li>Let <var>registration</var> be the result of running <a href="#get-registration-algorithm">Get Registration</a> algorithm passing <var>parsedMatchingScope</var> as the argument.
       <li>If <var>registration</var> is not null and <var>registration</var>’s <a href="#dfn-uninstalling-flag" id="ref-for-dfn-uninstalling-flag⑤">uninstalling flag</a> is set, return null.
       <li>Return <var>registration</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="get-registration-algorithm">
      <h3 class="heading settled" id="get-registration-algorithm"><span class="content">Get Registration</span><a class="self-link" href="#get-registration-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>scope</var>, a <a data-link-type="dfn">URL</a>
       <dt>Output
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑥⓪">service worker registration</a>
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>scopeString</var> be the empty string.
       <li>If <var>scope</var> is not null, set <var>scopeString</var> to <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-serializer" id="ref-for-concept-url-serializer⑦">serialized</a> <var>scope</var> with the <em>exclude fragment flag</em> set.
       <li>Let <var>registration</var> be null.
       <li>
        For each <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type" id="ref-for-sec-list-and-record-specification-type②⓪">Record</a> {[[key]], [[value]]} <var>entry</var> of its <a href="#dfn-scope-to-registration-map" id="ref-for-dfn-scope-to-registration-map①①">scope to registration map</a>: 
        <ol>
         <li>If <var>scopeString</var> matches <var>entry</var>.[[key]], set <var>registration</var> to <var>entry</var>.[[value]].
        </ol>
       <li>Return <var>registration</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="get-newest-worker-algorithm">
      <h3 class="heading settled" id="get-newest-worker-algorithm"><span class="content">Get Newest Worker</span><a class="self-link" href="#get-newest-worker-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>registration</var>, a <a href="#dfn-service-worker-registration" id="ref-for-dfn-service-worker-registration⑥①">service worker registration</a>
       <dt>Output
       <dd><var>worker</var>, a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①⓪">service worker</a>
      </dl>
      <ol>
       <li>Run the following steps atomically.
       <li>Let <var>newestWorker</var> be null.
       <li>If <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker②⓪">installing worker</a> is not null, set <var>newestWorker</var> to <var>registration</var>’s <a href="#dfn-installing-worker" id="ref-for-dfn-installing-worker②①">installing worker</a>.
       <li>Else if <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker②①">waiting worker</a> is not null, set <var>newestWorker</var> to <var>registration</var>’s <a href="#dfn-waiting-worker" id="ref-for-dfn-waiting-worker②②">waiting worker</a>.
       <li>Else if <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker④②">active worker</a> is not null, set <var>newestWorker</var> to <var>registration</var>’s <a href="#dfn-active-worker" id="ref-for-dfn-active-worker④③">active worker</a>.
       <li>Return <var>newestWorker</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="create-client-algorithm">
      <h3 class="heading settled" id="create-client-algorithm"><span class="content">Create Client</span><a class="self-link" href="#create-client-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>client</var>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④⑦">service worker client</a>
       <dt>Output
       <dd><var>clientObject</var>, a <code class="idl"><a data-link-type="idl" href="#client-interface" id="ref-for-client-interface⑧">Client</a></code> object
      </dl>
      <ol>
       <li>Let <var>clientObject</var> be a new <code class="idl"><a data-link-type="idl" href="#client-interface" id="ref-for-client-interface⑨">Client</a></code> object.
       <li>Set <var>clientObject</var>’s <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client①⓪">service worker client</a> to <var>client</var>.
       <li>Return <var>clientObject</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="create-windowclient-algorithm">
      <h3 class="heading settled" id="create-windowclient-algorithm"><span class="content">Create Window Client</span><a class="self-link" href="#create-windowclient-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>client</var>, a <a href="#dfn-service-worker-client" id="ref-for-dfn-service-worker-client④⑧">service worker client</a>
       <dd><var>visibilityState</var>, a string
       <dd><var>focusState</var>, a boolean
       <dt>Output
       <dd><var>windowClient</var>, a <code class="idl"><a data-link-type="idl" href="#window-client-interface" id="ref-for-window-client-interface⑥">WindowClient</a></code> object
      </dl>
      <ol>
       <li>Let <var>windowClient</var> be a new <code class="idl"><a data-link-type="idl" href="#window-client-interface" id="ref-for-window-client-interface⑦">WindowClient</a></code> object.
       <li>Set <var>windowClient</var>’s <a href="#dfn-service-worker-client-client" id="ref-for-dfn-service-worker-client-client①①">service worker client</a> to <var>client</var>.
       <li>Set <var>windowClient</var>’s <a href="#dfn-service-worker-client-visibilitystate" id="ref-for-dfn-service-worker-client-visibilitystate①">visibility state</a> to <var>visibilityState</var>.
       <li>Set <var>windowClient</var>’s <a href="#dfn-service-worker-client-focusstate" id="ref-for-dfn-service-worker-client-focusstate②">focus state</a> to <var>focusState</var>.
       <li>Return <var>windowClient</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="query-cache-algorithm">
      <h3 class="heading settled" id="query-cache-algorithm"><span class="content">Query Cache</span><a class="self-link" href="#query-cache-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>request</var>, a <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②①">Request</a></code> object
       <dd><var>options</var>, a <code class="idl"><a data-link-type="idl" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions⑥">CacheQueryOptions</a></code> object, optional
       <dd><var>targetStorage</var>, an array that has [<code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②②">Request</a></code>, <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⑥">Response</a></code>] pairs as its elements, optional
       <dt>Output
       <dd><var>resultArray</var>, an array that has [<code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②③">Request</a></code>, <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⑦">Response</a></code>] pairs as its elements
      </dl>
      <ol>
       <li>Let <var>requestArray</var> be an empty array.
       <li>Let <var>responseArray</var> be an empty array.
       <li>Let <var>resultArray</var> be an empty array.
       <li>If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachequeryoptions-ignoremethod" id="ref-for-dom-cachequeryoptions-ignoremethod">ignoreMethod</a></code> is false and <var>request</var>.<var>method</var> is not `<code>GET</code>`, return <var>resultArray</var>.
       <li>Let <var>cachedURL</var> and <var>requestURL</var> be null.
       <li>
        If the optional argument <var>targetStorage</var> is omitted, then: 
        <ol>
         <li>
          For each <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record①⓪">fetching record</a> <var>entry</var> of its <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⑥">request to response map</a>, in key insertion order: 
          <ol>
           <li>Set <var>cachedURL</var> to <var>entry</var>.[[key]]'s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①⓪">request</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url⑨">url</a>.
           <li>Set <var>requestURL</var> to <var>request</var>’s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①①">request</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①⓪">url</a>.
           <li>
            If <var>options</var>.<var>ignoreSearch</var> is true, then: 
            <ol>
             <li>Set <var>cachedURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-query" id="ref-for-concept-url-query">query</a> to the empty string.
             <li>Set <var>requestURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-query" id="ref-for-concept-url-query①">query</a> to the empty string.
            </ol>
           <li>
            If <var>cachedURL</var> <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals③">equals</a> <var>requestURL</var> with the <em>exclude fragments flag</em> set, then: 
            <ol>
             <li>Add a copy of <var>entry</var>.[[key]] to <var>requestArray</var>.
             <li>Add a copy of <var>entry</var>.[[value]] to <var>responseArray</var>.
            </ol>
          </ol>
        </ol>
       <li>
        Else: 
        <ol>
         <li>
          For each <var>record</var> in <var>targetStorage</var>: 
          <ol>
           <li>Set <var>cachedURL</var> to <var>record</var>[0]'s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①②">request</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①①">url</a>.
           <li>Set <var>requestURL</var> to <var>request</var>’s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①③">request</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①②">url</a>.
           <li>
            If <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachequeryoptions-ignoresearch" id="ref-for-dom-cachequeryoptions-ignoresearch">ignoreSearch</a></code> is true, then: 
            <ol>
             <li>Set <var>cachedURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-query" id="ref-for-concept-url-query②">query</a> to the empty string.
             <li>Set <var>requestURL</var>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-query" id="ref-for-concept-url-query③">query</a> to the empty string.
            </ol>
           <li>
            If <var>cachedURL</var> <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-equals" id="ref-for-concept-url-equals④">equals</a> <var>requestURL</var> with the <em>exclude fragments flag</em> set, then: 
            <ol>
             <li>Add <var>record</var>[0] to <var>requestArray</var>.
             <li>Add <var>record</var>[1] to <var>responseArray</var>.
            </ol>
          </ol>
        </ol>
       <li>
        For each <var>cachedResponse</var> in <var>responseArray</var> with the index <var>index</var>: 
        <ol>
         <li>Let <var>cachedRequest</var> be the <var>index</var>th element in <var>requestArray</var>.
         <li>
          If <var>cachedResponse</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-response" id="ref-for-concept-response-response⑦">response</a>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-response-header-list" id="ref-for-concept-response-header-list④">header list</a> contains no <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header②">header</a> <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header-name" id="ref-for-concept-header-name②">named</a> `<code>Vary</code>`, or <var>options</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachequeryoptions-ignorevary" id="ref-for-dom-cachequeryoptions-ignorevary">ignoreVary</a></code> is true, then: 
          <ol>
           <li>Add an array [<var>cachedRequest</var>, <var>cachedResponse</var>] to <var>resultArray</var>.
           <li>Continue to the next iteration of the loop.
          </ol>
         <li>Let <var>varyHeaders</var> be the array containing the elements corresponding to the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7230#section-3.2" id="ref-for-section-3.2②">field-values</a> of the <a data-link-type="dfn" href="https://tools.ietf.org/html/rfc7231#section-7.1.4" id="ref-for-section-7.1.4②">Vary</a> header.
         <li>Let <var>matchFailed</var> be false.
         <li>
          For each <var>f</var> in <var>varyHeaders</var>: 
          <ol>
           <li>
            If <var>f</var> matches "<code>*</code>", or the result of running <var>cachedRequest</var>.<code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-headers" id="ref-for-dom-request-headers①">headers</a></code> object’s <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-headers-get" id="ref-for-dom-headers-get">get(name)</a></code> method with <var>f</var> as the argument does not match the result of running <var>request</var>.<code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-request-headers" id="ref-for-dom-request-headers②">headers</a></code> object’s <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#dom-headers-get" id="ref-for-dom-headers-get①">get(name)</a></code> method with <var>f</var> as the argument, then: 
            <ol>
             <li>Set <var>matchFailed</var> to true.
             <li>Break the loop.
            </ol>
          </ol>
         <li>If <var>matchFailed</var> is false, add an array [<var>cachedRequest</var>, <var>cachedResponse</var>] to <var>resultArray</var>.
        </ol>
       <li>Return <var>resultArray</var>.
      </ol>
     </section>
     <section class="algorithm" data-algorithm="batch-cache-operations-algorithm">
      <h3 class="heading settled" id="batch-cache-operations-algorithm"><span class="content">Batch Cache Operations</span><a class="self-link" href="#batch-cache-operations-algorithm"></a></h3>
      <dl>
       <dt>Input
       <dd><var>operations</var>, an array of <code class="idl"><a data-link-type="idl" href="#dictdef-cache-cachebatchoperation" id="ref-for-dictdef-cache-cachebatchoperation③">CacheBatchOperation</a></code> dictionary objects
       <dt>Output
       <dd><var>promise</var>, a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑥⓪">promise</a> resolves with an array of <code class="idl"><a data-link-type="idl" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⑧">Response</a></code> objects.
      </dl>
      <ol>
       <li>Let <var>p</var> be a <a data-link-type="dfn" href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects" id="ref-for-sec-promise-objects⑥①">promise</a> resolved with no value.
       <li>
        Return the result of <a data-link-type="dfn" href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by" id="ref-for-transforming-by⑧">transforming</a> <var>p</var> with a fulfillment handler that performs the following substeps <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel" id="ref-for-in-parallel③⑤">in parallel</a>: 
        <ol>
         <li>Let <var>itemsCopy</var> be a new <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⑦">request to response map</a> that is a copy of its <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③⑥">context object</a>’s <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⑧">request to response map</a>.
         <li>Let <var>addedRecords</var> be an empty array.
         <li>
          Try running the following substeps atomically: 
          <ol>
           <li>Let <var>resultArray</var> be an empty array.
           <li>
            For each <var>operation</var> in <var>operations</var> with the index <var>index</var>: 
            <ol>
             <li>If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type③">type</a></code> matches neither "delete" nor "put", <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⑦">throw</a> a <code>TypeError</code>.
             <li>If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type④">type</a></code> matches "delete" and <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response②">response</a></code> is not null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⑧">throw</a> a <code>TypeError</code>.
             <li>If the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request③">request</a></code>, <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-options" id="ref-for-dom-cachebatchoperation-options①">options</a></code>, and <var>addedRecords</var> as the arguments is not an empty array, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw①⑨">throw</a> an "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror" id="ref-for-invalidstateerror⑧">InvalidStateError</a></code>" exception.
             <li>Let <var>requestResponseArray</var> be the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request④">request</a></code> and <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-options" id="ref-for-dom-cachebatchoperation-options②">options</a></code> as the arguments.
             <li>
              For each <var>requestResponse</var> in <var>requestResponseArray</var>: 
              <ol>
               <li>If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type⑤">type</a></code> matches "delete", remove the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record①①">fetching record</a> from <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map①⑨">request to response map</a>.
              </ol>
             <li>
              If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-type" id="ref-for-dom-cachebatchoperation-type⑥">type</a></code> matches "put", then: 
              <ol>
               <li>If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response③">response</a></code> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②⓪">throw</a> a <code>TypeError</code>.
               <li>Let <var>r</var> be <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request⑤">request</a></code>'s associated <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-request" id="ref-for-concept-request-request①④">request</a>.
               <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-url" id="ref-for-concept-request-url①③">url</a>’s <a data-link-type="dfn" href="https://url.spec.whatwg.org/#concept-url-scheme" id="ref-for-concept-url-scheme⑥">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②①">throw</a> a <code>TypeError</code>.
               <li>If <var>r</var>’s <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-request-method" id="ref-for-concept-request-method⑤">method</a> is not `<code>GET</code>`, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②②">throw</a> a <code>TypeError</code>.
               <li>If <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-options" id="ref-for-dom-cachebatchoperation-options③">options</a></code> is not null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②③">throw</a> a <code>TypeError</code>.
               <li>Set <var>requestResponseArray</var> to the result of running <a href="#query-cache-algorithm">Query Cache</a> algorithm passing <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request⑥">request</a></code>.
               <li>
                If <var>requestResponseArray</var> is not an empty array, then: 
                <ol>
                 <li>Let <var>requestResponse</var> be <var>requestResponseArray</var>[0].
                 <li>Let <var>fetchingRecord</var> be the corresponding <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record①②">fetching record</a> for <var>requestResponse</var>[0] and <var>requestResponse</var>[1] in <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map②⓪">request to response map</a>.
                 <li>Set <var>fetchingRecord</var>.[[key]] to <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request⑦">request</a></code> and <var>fetchingRecord</var>.[[value]] to <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response④">response</a></code>.
                </ol>
               <li>
                Else: 
                <ol>
                 <li>Set a newly-created <a href="#dfn-fetching-record" id="ref-for-dfn-fetching-record①③">fetching record</a> {[[key]]: <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-request" id="ref-for-dom-cachebatchoperation-request⑧">request</a></code>, [[value]]: <var>operation</var>.<code class="idl"><a data-link-type="idl" href="#dom-cachebatchoperation-response" id="ref-for-dom-cachebatchoperation-response⑤">response</a></code>} to <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map②①">request to response map</a>.
                </ol>
                <p class="note" role="note">The cache commit is allowed as long as the response’s headers are available.</p>
               <li>If the cache write operation in the previous two steps failed due to exceeding the granted quota limit, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②④">throw</a> a "<code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#quotaexceedederror" id="ref-for-quotaexceedederror②">QuotaExceededError</a></code>" exception.
               <li>Add an array [<var>operation</var>.<var>request</var>, <var>operation</var>.<var>response</var>] to <var>addedRecords</var>.
              </ol>
             <li>Add <var>operation</var>.<var>response</var> to <var>resultArray</var>.
            </ol>
           <li>Return <var>resultArray</var>.
          </ol>
         <li>
          And then, if an exception was <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②⑤">thrown</a>, then: 
          <ol>
           <li>Set the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#context-object" id="ref-for-context-object③⑦">context object</a>’s <a href="#dfn-request-to-response-map" id="ref-for-dfn-request-to-response-map②②">request to response map</a> to <var>itemsCopy</var>.
           <li><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw" id="ref-for-dfn-throw②⑥">Throw</a> the exception
          </ol>
        </ol>
      </ol>
     </section>
    </section>
    <section>
     <h2 class="heading settled" id="extended-http-headers"><span class="content">Appendix B: Extended HTTP headers</span><a class="self-link" href="#extended-http-headers"></a></h2>
     <section>
      <h3 class="heading settled" id="service-worker-script-request"><span class="content">Service Worker Script Request</span><a class="self-link" href="#service-worker-script-request"></a></h3>
      <p>An HTTP request to <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-fetch" id="ref-for-concept-fetch①②">fetch</a> a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①①">service worker</a>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource⑧">script resource</a> will include the following <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header③">header</a>:</p>
      <dl>
       <dt>`<dfn data-dfn-type="dfn" data-noexport id="service-worker"><code>Service-Worker</code><a class="self-link" href="#service-worker"></a></dfn>`
       <dd>
        Indicates this request is a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①②">service worker</a>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource⑨">script resource</a> request. 
        <p class="note" role="note">This header helps administrators log the requests and detect threats.</p>
      </dl>
     </section>
     <section>
      <h3 class="heading settled" id="service-worker-script-response"><span class="content">Service Worker Script Response</span><a class="self-link" href="#service-worker-script-response"></a></h3>
      <p>An HTTP response to a <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①③">service worker</a>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource①⓪">script resource</a> request can include the following <a data-link-type="dfn" href="https://fetch.spec.whatwg.org/#concept-header" id="ref-for-concept-header④">header</a>:</p>
      <dl>
       <dt>`<dfn data-dfn-type="dfn" data-noexport id="service-worker-allowed"><code>Service-Worker-Allowed</code><a class="self-link" href="#service-worker-allowed"></a></dfn>`
       <dd>
        Indicates the user agent will override the path restriction, which limits the maximum allowed <a href="#dfn-scope-url" id="ref-for-dfn-scope-url①⑧">scope url</a> that the script can <a href="#dfn-control" id="ref-for-dfn-control④">control</a>, to the given value. 
        <p class="note" role="note">The value is a URL. If a relative URL is given, it is parsed against the script’s URL.</p>
      </dl>
      <div class="example" id="example-b2cf2c95">
       <a class="self-link" href="#example-b2cf2c95"></a> Default scope: 
<pre class="lang-js highlight"><c- c1>// Maximum allowed scope defaults to the path the script sits in</c->
<c- c1>// "/js" in this example</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/js/sw.js"</c-><c- p>).</c->then<c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- u>"Install succeeded with the default scope '/js'."</c-><c- p>);</c->
<c- p>});</c->
</pre>
      </div>
      <div class="example" id="example-bbe203d2">
       <a class="self-link" href="#example-bbe203d2"></a> Upper path without Service-Worker-Allowed header: 
<pre class="lang-js highlight"><c- c1>// Set the scope to an upper path of the script location</c->
<c- c1>// Response has no Service-Worker-Allowed header</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/js/sw.js"</c-><c- p>,</c-> <c- p>{</c-> scope<c- o>:</c-> <c- u>"/"</c-> <c- p>}).</c-><c- k>catch</c-><c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- u>"Install failed due to the path restriction violation."</c-><c- p>);</c->
<c- p>});</c->
</pre>
      </div>
      <div class="example" id="example-24d16885">
       <a class="self-link" href="#example-24d16885"></a> Upper path with Service-Worker-Allowed header: 
<pre class="lang-js highlight"><c- c1>// Set the scope to an upper path of the script location</c->
<c- c1>// Response included "Service-Worker-Allowed : /"</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/js/sw.js"</c-><c- p>,</c-> <c- p>{</c-> scope<c- o>:</c-> <c- u>"/"</c-> <c- p>}).</c->then<c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
  console<c- p>.</c->log<c- p>(</c-><c- u>"Install succeeded as the max allowed scope was overriden to '/'."</c-><c- p>);</c->
<c- p>});</c->
</pre>
      </div>
      <div class="example" id="example-2e984925">
       <a class="self-link" href="#example-2e984925"></a> A path restriction voliation even with Service-Worker-Allowed header: 
<pre class="lang-js highlight"><c- c1>// Set the scope to an upper path of the script location</c->
<c- c1>// Response included "Service-Worker-Allowed : /foo"</c->
navigator<c- p>.</c->serviceWorker<c- p>.</c->register<c- p>(</c-><c- u>"/foo/bar/sw.js"</c-><c- p>,</c-> <c- p>{</c-> scope<c- o>:</c-> <c- u>"/"</c-> <c- p>}).</c-><c- k>catch</c-><c- p>(</c-><c- a>function</c-><c- p>()</c-> <c- p>{</c->
  console<c- p>.</c->error<c- p>(</c-><c- u>"Install failed as the scope is still out of the overriden maximum allowed scope."</c-><c- p>);</c->
<c- p>});</c->
</pre>
      </div>
     </section>
     <section>
      <h3 class="heading settled" id="syntax"><span class="content">Syntax</span><a class="self-link" href="#syntax"></a></h3>
      <p><a data-link-type="biblio" href="#biblio-rfc5234">ABNF</a> for the values of the headers used by the <a href="#dfn-service-worker" id="ref-for-dfn-service-worker①①④">service worker</a>’s <a href="#dfn-script-resource" id="ref-for-dfn-script-resource①①">script resource</a> requests and responses:</p>
<pre>Service-Worker = %x73.63.72.69.70.74 ; "script", case-sensitive
</pre>
      <p class="note" role="note">The validation of the Service-Worker-Allowed header’s values is done by URL parsing algorithm (in Update algorithm) instead of using ABNF.</p>
     </section>
    </section>
    <section>
     <h2 class="heading settled" data-level="9" id="acknowledgements"><span class="secno">9. </span><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2>
     <p>Deep thanks go to Andrew Betts for organizing and hosting a small workshop of like-minded individuals including: Jake Archibald, Jackson Gabbard, Tobie Langel, Robin Berjon, Patrick Lauke, Christian Heilmann. From the clarity of the day’s discussions and the use-cases outlined there, much has become possible. Further thanks to Andrew for raising consciousness about the offline problem. His organization of EdgeConf and inclusion of Offline as a persistent topic there has created many opportunities and connections that have enabled this work to progress.</p>
     <p>Anne van Kesteren has generously lent his encyclopedic knowledge of Web Platform arcana and standards development experience throughout the development of the service worker. This specification would be incomplete without his previous work in describing the real-world behavior of URLs, HTTP Fetch, Promises, and DOM. Similarly, this specification would not be possible without Ian Hickson’s rigorous Web Worker spec. Much thanks to him.</p>
     <p>In no particular order, deep gratitude for design guidance and discussion goes to: Jungkee Song, Alec Flett, David Barrett-Kahn, Aaron Boodman, Michael Nordman, Tom Ashworth, Kinuko Yasuda, Darin Fisher, Jonas Sicking, Jesús Leganés Combarro, Mark Christian, Dave Hermann, Yehuda Katz, François Remy, Ilya Grigorik, Will Chan, Domenic Denicola, Nikhil Marathe, Yves Lafon, Adam Barth, Greg Simon, Devdatta Akhawe, Dominic Cooney, Jeffrey Yasskin, Joshua Bell, Boris Zbarsky, Matt Falkenhagen, Tobie Langel, Gavin Peters, Ben Kelly, Hiroki Nakagawa, Jake Archibald, Josh Soref, Jinho Bang and Yutaka Hirano.</p>
     <p>Jason Weber, Chris Wilson, Paul Kinlan, Ehsan Akhgari, and Daniel Austin have provided valuable, well-timed feedback on requirements and the standardization process.</p>
     <p>The authors would also like to thank Dimitri Glazkov for his scripts and formatting tools which have been essential in the production of this specification. The authors are also grateful for his considerable guidance.</p>
     <p>Thanks also to Vivian Cromwell, Greg Simon, Alex Komoroske, Wonsuk Lee, and Seojin Kim for their considerable professional support.</p>
    </section>
   </section>
  </main>
  <div data-fill-with="conformance">
   <h2 class="no-ref no-num heading settled" id="conformance"><span class="content">Conformance</span><a class="self-link" href="#conformance"></a></h2>
   <h3 class="no-ref no-num heading settled" id="conventions"><span class="content">Document conventions</span><a class="self-link" href="#conventions"></a></h3>
   <p>Conformance requirements are expressed with a combination of
    descriptive assertions and RFC 2119 terminology. The key words “MUST”,
    “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
    “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
    document are to be interpreted as described in RFC 2119.
    However, for readability, these words do not appear in all uppercase
    letters in this specification. </p>
   <p>All of the text of this specification is normative except sections
    explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
   <p>Examples in this specification are introduced with the words “for example”
    or are set apart from the normative text with <code>class="example"</code>,
    like this: </p>
   <div class="example" id="example-ae2b6bc0">
    <a class="self-link" href="#example-ae2b6bc0"></a> 
    <p>This is an example of an informative example.</p>
   </div>
   <p>Informative notes begin with the word “Note” and are set apart from the
    normative text with <code>class="note"</code>, like this: </p>
   <p class="note" role="note">Note, this is an informative note.</p>
   <h3 class="no-ref no-num heading settled" id="conformant-algorithms"><span class="content">Conformant Algorithms</span><a class="self-link" href="#conformant-algorithms"></a></h3>
   <p>Requirements phrased in the imperative as part of algorithms (such as
    "strip any leading space characters" or "return false and abort these
    steps") are to be interpreted with the meaning of the key word ("must",
    "should", "may", etc) used in introducing the algorithm.</p>
   <p>Conformance requirements phrased as algorithms or specific steps can be
    implemented in any manner, so long as the end result is equivalent. In
    particular, the algorithms defined in this specification are intended to
    be easy to understand and are not intended to be performant. Implementers
    are encouraged to optimize.</p>
  </div>
  <p id="back-to-top" role="navigation"><a href="#toc"><abbr title="Back to top">↑</abbr></a></p>
  . 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#service-worker-global-scope-activate-event">activate</a><span>, in §4.7</span>
   <li><a href="#dom-serviceworkerstate-activated">"activated"</a><span>, in §3.1</span>
   <li><a href="#dom-serviceworkerstate-activating">"activating"</a><span>, in §3.1</span>
   <li><a href="#service-worker-registration-active-attribute">active</a><span>, in §3.2.3</span>
   <li>
    active worker
    <ul>
     <li><a href="#dfn-service-worker-client-active-worker">dfn for service worker client</a><span>, in §2.3</span>
     <li><a href="#dfn-active-worker">dfn for service worker registration</a><span>, in §2.2</span>
    </ul>
   <li><a href="#cache-addAll-method">addAll(requests)</a><span>, in §5.4.4</span>
   <li><a href="#cache-add-method">add(request)</a><span>, in §5.4.3</span>
   <li><a href="#dom-clienttype-all">"all"</a><span>, in §4.3</span>
   <li><a href="#dom-frametype-auxiliary">"auxiliary"</a><span>, in §4.2</span>
   <li><a href="#cache-interface">Cache</a><span>, in §5.4</span>
   <li><a href="#dictdef-cache-cachebatchoperation">CacheBatchOperation</a><span>, in §5.4</span>
   <li><a href="#dom-cachequeryoptions-cachename">cacheName</a><span>, in §5.4</span>
   <li><a href="#dictdef-cache-cachequeryoptions">CacheQueryOptions</a><span>, in §5.4</span>
   <li><a href="#global-caches-attribute">caches</a><span>, in §5.3.1</span>
   <li><a href="#cache-storage-interface">CacheStorage</a><span>, in §5.5</span>
   <li><a href="#clients-claim-method">claim()</a><span>, in §4.3.4</span>
   <li><a href="#client-interface">Client</a><span>, in §4.2</span>
   <li><a href="#dfn-job-client">client</a><span>, in §Unnumbered section</span>
   <li>
    clientId
    <ul>
     <li><a href="#fetch-event-clientid-attribute">attribute for FetchEvent</a><span>, in §4.5.2</span>
     <li><a href="#dom-fetcheventinit-clientid">dict-member for FetchEventInit</a><span>, in §4.5</span>
    </ul>
   <li><a href="#dfn-client-message-queue">client message queue</a><span>, in §3.4</span>
   <li><a href="#dictdef-clients-clientqueryoptions">ClientQueryOptions</a><span>, in §4.3</span>
   <li><a href="#clients-interface">Clients</a><span>, in §4.3</span>
   <li><a href="#service-worker-global-scope-clients-attribute">clients</a><span>, in §4.1.1</span>
   <li><a href="#enumdef-clients-clienttype">ClientType</a><span>, in §4.3</span>
   <li><a href="#dfn-containing-service-worker-registration">containing service worker registration</a><span>, in §2.1</span>
   <li><a href="#dfn-control">control</a><span>, in §2.4</span>
   <li><a href="#service-worker-container-controller-attribute">controller</a><span>, in §3.4.1</span>
   <li><a href="#service-worker-container-controllerchange-event">controllerchange</a><span>, in §3.6</span>
   <li>
    data
    <ul>
     <li><a href="#extendablemessage-event-data-attribute">attribute for ExtendableMessageEvent</a><span>, in §4.6.1</span>
     <li><a href="#serviceworkermessage-event-data-attribute">attribute for ServiceWorkerMessageEvent</a><span>, in §3.5.1</span>
     <li><a href="#dom-extendablemessageeventinit-data">dict-member for ExtendableMessageEventInit</a><span>, in §4.6</span>
     <li><a href="#dom-serviceworkermessageeventinit-data">dict-member for ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
    </ul>
   <li><a href="#dfn-dedicatedworker-client">dedicated worker client</a><span>, in §2.3</span>
   <li><a href="#cache-storage-delete-method">delete(cacheName)</a><span>, in §5.5.4</span>
   <li><a href="#cache-delete-method">delete(request)</a><span>, in §5.4.6</span>
   <li><a href="#cache-delete-method">delete(request, options)</a><span>, in §5.4.6</span>
   <li><a href="#dfn-job-equivalent">equivalent</a><span>, in §Unnumbered section</span>
   <li><a href="#extendable-event-interface">ExtendableEvent</a><span>, in §4.4</span>
   <li><a href="#dictdef-extendableeventinit">ExtendableEventInit</a><span>, in §4.4</span>
   <li><a href="#dom-extendableevent-extendableevent">ExtendableEvent(type)</a><span>, in §4.4</span>
   <li><a href="#dom-extendableevent-extendableevent">ExtendableEvent(type, eventInitDict)</a><span>, in §4.4</span>
   <li><a href="#extendablemessage-event-interface">ExtendableMessageEvent</a><span>, in §4.6</span>
   <li><a href="#dictdef-extendablemessageevent-extendablemessageeventinit">ExtendableMessageEventInit</a><span>, in §4.6</span>
   <li><a href="#dom-extendablemessageevent-extendablemessageevent">ExtendableMessageEvent(type)</a><span>, in §4.6</span>
   <li><a href="#dom-extendablemessageevent-extendablemessageevent">ExtendableMessageEvent(type, eventInitDict)</a><span>, in §4.6</span>
   <li><a href="#dfn-extend-lifetime-promises">extend lifetime promises</a><span>, in §4.4</span>
   <li><a href="#extensions-allowed-flag">extensions allowed flag</a><span>, in §4.4</span>
   <li><a href="#service-worker-global-scope-fetch-event">fetch</a><span>, in §4.7</span>
   <li><a href="#fetch-event-interface">FetchEvent</a><span>, in §4.5</span>
   <li><a href="#dictdef-fetchevent-fetcheventinit">FetchEventInit</a><span>, in §4.5</span>
   <li><a href="#dom-fetchevent-fetchevent">FetchEvent(type, eventInitDict)</a><span>, in §4.5</span>
   <li><a href="#dfn-fetching-record">fetching record</a><span>, in §5.1</span>
   <li><a href="#client-focus-method">focus()</a><span>, in §4.2.7</span>
   <li><a href="#client-focused-attribute">focused</a><span>, in §4.2.6</span>
   <li><a href="#dfn-service-worker-client-focusstate">focus state</a><span>, in §4.2</span>
   <li><a href="#dfn-job-force-bypass-cache-flag">force bypass cache flag</a><span>, in §Unnumbered section</span>
   <li><a href="#contextframetype-enum">FrameType</a><span>, in §4.2.2</span>
   <li><a href="#dfn-service-worker-client-frame-type">frame type</a><span>, in §2.3</span>
   <li><a href="#client-frametype-attribute">frameType</a><span>, in §4.2.2</span>
   <li><a href="#dfn-functional-events">functional events</a><span>, in §2.1</span>
   <li><a href="#clients-get-method">get(id)</a><span>, in §4.3.1</span>
   <li><a href="#service-worker-container-getregistration-method">getRegistration()</a><span>, in §3.4.4</span>
   <li><a href="#service-worker-container-getregistration-method">getRegistration(clientURL)</a><span>, in §3.4.4</span>
   <li><a href="#service-worker-container-getregistrations-method">getRegistrations()</a><span>, in §3.4.5</span>
   <li><a href="#cachestorage-global-object">global object</a><span>, in §5.5</span>
   <li><a href="#dfn-handle-fetch-task-source">handle fetch task source</a><span>, in §2.5</span>
   <li><a href="#dfn-handle-functional-event-task-source">handle functional event task source</a><span>, in §2.5</span>
   <li><a href="#cache-storage-has-method">has(cacheName)</a><span>, in §5.5.2</span>
   <li><a href="#dfn-has-ever-been-evaluated-flag">has ever been evaluated flag</a><span>, in §2.1</span>
   <li><a href="#dfn-https-state">HTTPS state</a><span>, in §2.1</span>
   <li>
    id
    <ul>
     <li><a href="#client-id-attribute">attribute for Client</a><span>, in §4.2.3</span>
     <li><a href="#dfn-service-worker-id">dfn for service worker</a><span>, in §2.1</span>
     <li><a href="#dfn-service-worker-client-id">dfn for service worker client</a><span>, in §2.3</span>
    </ul>
   <li><a href="#dom-cachequeryoptions-ignoremethod">ignoreMethod</a><span>, in §5.4</span>
   <li><a href="#dom-cachequeryoptions-ignoresearch">ignoreSearch</a><span>, in §5.4</span>
   <li><a href="#dom-cachequeryoptions-ignorevary">ignoreVary</a><span>, in §5.4</span>
   <li><a href="#dfn-imported-scripts-updated-flag">imported scripts updated flag</a><span>, in §2.1</span>
   <li><a href="#importscripts-method">importScripts(urls)</a><span>, in §6.3.2</span>
   <li><a href="#dom-clientqueryoptions-includeuncontrolled">includeUncontrolled</a><span>, in §4.3</span>
   <li><a href="#dfn-incumbent-record">incumbent record</a><span>, in §5.1</span>
   <li><a href="#service-worker-global-scope-install-event">install</a><span>, in §4.7</span>
   <li><a href="#dom-serviceworkerstate-installed">"installed"</a><span>, in §3.1</span>
   <li><a href="#dom-serviceworkerstate-installing">"installing"</a><span>, in §3.1</span>
   <li><a href="#service-worker-registration-installing-attribute">installing</a><span>, in §3.2.1</span>
   <li><a href="#dfn-installing-worker">installing worker</a><span>, in §2.2</span>
   <li>
    isReload
    <ul>
     <li><a href="#fetch-event-isreload-attribute">attribute for FetchEvent</a><span>, in §4.5.3</span>
     <li><a href="#dom-fetcheventinit-isreload">dict-member for FetchEventInit</a><span>, in §4.5</span>
    </ul>
   <li><a href="#dfn-job">job</a><span>, in §Unnumbered section</span>
   <li><a href="#dfn-job-promise">job promise</a><span>, in §Unnumbered section</span>
   <li><a href="#dfn-job-queue">job queue</a><span>, in §Unnumbered section</span>
   <li><a href="#dfn-job-type">job type</a><span>, in §Unnumbered section</span>
   <li>
    keys()
    <ul>
     <li><a href="#cache-keys-method">method for Cache</a><span>, in §5.4.7</span>
     <li><a href="#cache-storage-keys-method">method for CacheStorage</a><span>, in §5.5.5</span>
    </ul>
   <li><a href="#cache-keys-method">keys(request)</a><span>, in §5.4.7</span>
   <li><a href="#cache-keys-method">keys(request, options)</a><span>, in §5.4.7</span>
   <li>
    lastEventId
    <ul>
     <li><a href="#extendablemessage-event-lasteventid-attribute">attribute for ExtendableMessageEvent</a><span>, in §4.6.3</span>
     <li><a href="#serviceworkermessage-event-lasteventid-attribute">attribute for ServiceWorkerMessageEvent</a><span>, in §3.5.3</span>
     <li><a href="#dom-extendablemessageeventinit-lasteventid">dict-member for ExtendableMessageEventInit</a><span>, in §4.6</span>
     <li><a href="#dom-serviceworkermessageeventinit-lasteventid">dict-member for ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
    </ul>
   <li><a href="#dfn-last-update-check-time">last update check time</a><span>, in §2.2</span>
   <li><a href="#dfn-lifecycle-events">lifecycle events</a><span>, in §2.1</span>
   <li><a href="#dfn-job-list-of-equivalent-jobs">list of equivalent jobs</a><span>, in §Unnumbered section</span>
   <li>
    matchAll()
    <ul>
     <li><a href="#cache-matchall-method">method for Cache</a><span>, in §5.4.2</span>
     <li><a href="#clients-matchall-method">method for Clients</a><span>, in §4.3.2</span>
    </ul>
   <li><a href="#clients-matchall-method">matchAll(options)</a><span>, in §4.3.2</span>
   <li><a href="#cache-matchall-method">matchAll(request)</a><span>, in §5.4.2</span>
   <li><a href="#cache-matchall-method">matchAll(request, options)</a><span>, in §5.4.2</span>
   <li>
    match(request)
    <ul>
     <li><a href="#cache-match-method">method for Cache</a><span>, in §5.4.1</span>
     <li><a href="#cache-storage-match-method">method for CacheStorage</a><span>, in §5.5.1</span>
    </ul>
   <li>
    match(request, options)
    <ul>
     <li><a href="#cache-match-method">method for Cache</a><span>, in §5.4.1</span>
     <li><a href="#cache-storage-match-method">method for CacheStorage</a><span>, in §5.5.1</span>
    </ul>
   <li>
    message
    <ul>
     <li><a href="#service-worker-container-message-event">event for ServiceWorkerContainer</a><span>, in §3.6</span>
     <li><a href="#service-worker-global-scope-message-event">event for ServiceWorkerGlobalScope</a><span>, in §4.7</span>
    </ul>
   <li><a href="#dfn-name-to-cache-map">name to cache map</a><span>, in §5.1</span>
   <li><a href="#client-navigate-method">navigate()</a><span>, in §4.2.8</span>
   <li><a href="#dom-windowclient-navigate">navigate(url)</a><span>, in §4.2</span>
   <li><a href="#dom-frametype-nested">"nested"</a><span>, in §4.2</span>
   <li><a href="#dom-frametype-none">"none"</a><span>, in §4.2</span>
   <li><a href="#service-worker-global-scope-onactivate-attribute">onactivate</a><span>, in §4.1.4</span>
   <li><a href="#service-worker-container-oncontrollerchange-attribute">oncontrollerchange</a><span>, in §3.4.7</span>
   <li><a href="#service-worker-global-scope-onfetch-attribute">onfetch</a><span>, in §4.1.4</span>
   <li><a href="#service-worker-global-scope-oninstall-attribute">oninstall</a><span>, in §4.1.4</span>
   <li>
    onmessage
    <ul>
     <li><a href="#service-worker-container-onmessage-attribute">attribute for ServiceWorkerContainer</a><span>, in §3.4.7</span>
     <li><a href="#service-worker-global-scope-onmessage-attribute">attribute for ServiceWorkerGlobalScope</a><span>, in §4.1.4</span>
    </ul>
   <li><a href="#service-worker-onstatechange-attribute">onstatechange</a><span>, in §3.1.4</span>
   <li><a href="#service-worker-registration-onupdatefound-attribute">onupdatefound</a><span>, in §3.2.7</span>
   <li><a href="#cache-storage-open-method">open(cacheName)</a><span>, in §5.5.3</span>
   <li><a href="#clients-openwindow-method">openWindow(url)</a><span>, in §4.3.3</span>
   <li><a href="#dom-cachebatchoperation-options">options</a><span>, in §5.4</span>
   <li>
    origin
    <ul>
     <li><a href="#extendablemessage-event-origin-attribute">attribute for ExtendableMessageEvent</a><span>, in §4.6.2</span>
     <li><a href="#serviceworkermessage-event-origin-attribute">attribute for ServiceWorkerMessageEvent</a><span>, in §3.5.2</span>
     <li><a href="#dom-extendablemessageeventinit-origin">dict-member for ExtendableMessageEventInit</a><span>, in §4.6</span>
     <li><a href="#dom-serviceworkermessageeventinit-origin">dict-member for ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
    </ul>
   <li>
    ports
    <ul>
     <li><a href="#extendablemessage-event-ports-attribute">attribute for ExtendableMessageEvent</a><span>, in §4.6.5</span>
     <li><a href="#serviceworkermessage-event-ports-attribute">attribute for ServiceWorkerMessageEvent</a><span>, in §3.5.5</span>
     <li><a href="#dom-extendablemessageeventinit-ports">dict-member for ExtendableMessageEventInit</a><span>, in §4.6</span>
     <li><a href="#dom-serviceworkermessageeventinit-ports">dict-member for ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
    </ul>
   <li>
    postMessage(message)
    <ul>
     <li><a href="#client-postmessage-method">method for Client</a><span>, in §4.2.4</span>
     <li><a href="#service-worker-postmessage-method">method for ServiceWorker</a><span>, in §3.1.3</span>
    </ul>
   <li>
    postMessage(message, transfer)
    <ul>
     <li><a href="#client-postmessage-method">method for Client</a><span>, in §4.2.4</span>
     <li><a href="#service-worker-postmessage-method">method for ServiceWorker</a><span>, in §3.1.3</span>
    </ul>
   <li><a href="#fetchevent-potential-response">potential response</a><span>, in §4.5</span>
   <li><a href="#cache-put-method">put(request, response)</a><span>, in §5.4.5</span>
   <li><a href="#service-worker-container-ready-attribute">ready</a><span>, in §3.4.2</span>
   <li><a href="#dfn-ready-promise">ready promise</a><span>, in §3.4</span>
   <li><a href="#dom-serviceworkerstate-redundant">"redundant"</a><span>, in §3.1</span>
   <li><a href="#dfn-registration-script-url">registering script url</a><span>, in §2.2</span>
   <li><a href="#service-worker-container-register-method">register(scriptURL)</a><span>, in §3.4.3</span>
   <li><a href="#service-worker-container-register-method">register(scriptURL, options)</a><span>, in §3.4.3</span>
   <li><a href="#service-worker-global-scope-scope-attribute">registration</a><span>, in §4.1.2</span>
   <li><a href="#dictdef-serviceworkercontainer-registrationoptions">RegistrationOptions</a><span>, in §3.4</span>
   <li>
    request
    <ul>
     <li><a href="#fetch-event-request-attribute">attribute for FetchEvent</a><span>, in §4.5.1</span>
     <li><a href="#dom-cachebatchoperation-request">dict-member for CacheBatchOperation</a><span>, in §5.4</span>
     <li><a href="#dom-fetcheventinit-request">dict-member for FetchEventInit</a><span>, in §4.5</span>
    </ul>
   <li><a href="#dfn-request-to-response-map">request to response map</a><span>, in §5.1</span>
   <li><a href="#respond-with-entered-flag">respond-with entered flag</a><span>, in §4.5</span>
   <li><a href="#respond-with-error-flag">respond-with error flag</a><span>, in §4.5</span>
   <li><a href="#fetch-event-respondwith-method">respondWith(r)</a><span>, in §4.5.4</span>
   <li><a href="#dom-cachebatchoperation-response">response</a><span>, in §5.4</span>
   <li>
    scope
    <ul>
     <li><a href="#service-worker-registration-scope-attribute">attribute for ServiceWorkerRegistration</a><span>, in §3.2.4</span>
     <li><a href="#dom-registrationoptions-scope">dict-member for RegistrationOptions</a><span>, in §3.4</span>
    </ul>
   <li><a href="#dfn-scope-to-registration-map">scope to registration map</a><span>, in §Unnumbered section</span>
   <li>
    scope url
    <ul>
     <li><a href="#dfn-job-scope-url">definition of</a><span>, in §Unnumbered section</span>
     <li><a href="#dfn-scope-url">dfn for service worker registration</a><span>, in §2.2</span>
    </ul>
   <li><a href="#dfn-script-resource">script resource</a><span>, in §2.1</span>
   <li><a href="#dfn-script-resource-map">script resource map</a><span>, in §2.1</span>
   <li>
    script url
    <ul>
     <li><a href="#dfn-job-script-url">definition of</a><span>, in §Unnumbered section</span>
     <li><a href="#dfn-script-url">dfn for service worker</a><span>, in §2.1</span>
    </ul>
   <li><a href="#service-worker-url-attribute">scriptURL</a><span>, in §3.1.1</span>
   <li><a href="#dfn-service-worker-registration-selection">selection</a><span>, in §2.4</span>
   <li><a href="#navigator-service-worker-attribute">serviceWorker</a><span>, in §3.3</span>
   <li><a href="#service-worker">Service-Worker</a><span>, in §Unnumbered section</span>
   <li><a href="#service-worker-interface">ServiceWorker</a><span>, in §3.1</span>
   <li>
    service worker
    <ul>
     <li><a href="#dfn-service-worker">dfn for </a><span>, in §2.1</span>
     <li><a href="#dfn-service-worker-global-scope-service-worker">dfn for ServiceWorkerGlobalScope</a><span>, in §4.1</span>
    </ul>
   <li><a href="#service-worker-allowed">Service-Worker-Allowed</a><span>, in §Unnumbered section</span>
   <li>
    service worker client
    <ul>
     <li><a href="#dfn-service-worker-client">dfn for </a><span>, in §2.3</span>
     <li><a href="#dfn-service-worker-client-client">dfn for Client</a><span>, in §4.2</span>
     <li><a href="#dfn-service-worker-container-interface-client">dfn for ServiceWorkerContainer</a><span>, in §3.4</span>
    </ul>
   <li><a href="#service-worker-container-interface">ServiceWorkerContainer</a><span>, in §3.4</span>
   <li><a href="#service-worker-global-scope-interface">ServiceWorkerGlobalScope</a><span>, in §4.1</span>
   <li><a href="#serviceworkermessage-event-interface">ServiceWorkerMessageEvent</a><span>, in §3.5</span>
   <li><a href="#dictdef-serviceworkermessageevent-serviceworkermessageeventinit">ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
   <li><a href="#dom-serviceworkermessageevent-serviceworkermessageevent">ServiceWorkerMessageEvent(type)</a><span>, in §3.5</span>
   <li><a href="#dom-serviceworkermessageevent-serviceworkermessageevent">ServiceWorkerMessageEvent(type, eventInitDict)</a><span>, in §3.5</span>
   <li><a href="#service-worker-registration-interface">ServiceWorkerRegistration</a><span>, in §3.2</span>
   <li>
    service worker registration
    <ul>
     <li><a href="#dfn-service-worker-registration">dfn for </a><span>, in §2.2</span>
     <li><a href="#dfn-service-worker-registration-interface-service-worker-registration">dfn for ServiceWorkerRegistration</a><span>, in §3.2</span>
    </ul>
   <li><a href="#service-worker-state-enum">ServiceWorkerState</a><span>, in §3.1.2</span>
   <li><a href="#dfn-set-of-event-types-to-handle">set of event types to handle</a><span>, in §2.1</span>
   <li><a href="#dom-clienttype-sharedworker">"sharedworker"</a><span>, in §4.3</span>
   <li><a href="#dfn-sharedworker-client">shared worker client</a><span>, in §2.3</span>
   <li><a href="#service-worker-global-scope-skipwaiting-method">skipWaiting()</a><span>, in §4.1.3</span>
   <li><a href="#dfn-skip-waiting-flag">skip waiting flag</a><span>, in §2.1</span>
   <li>
    source
    <ul>
     <li><a href="#extendablemessage-event-source-attribute">attribute for ExtendableMessageEvent</a><span>, in §4.6.4</span>
     <li><a href="#serviceworkermessage-event-source-attribute">attribute for ServiceWorkerMessageEvent</a><span>, in §3.5.4</span>
     <li><a href="#dom-extendablemessageeventinit-source">dict-member for ExtendableMessageEventInit</a><span>, in §4.6</span>
     <li><a href="#dom-serviceworkermessageeventinit-source">dict-member for ServiceWorkerMessageEventInit</a><span>, in §3.5</span>
    </ul>
   <li><a href="#service-worker-container-startMessages-method">startMessages()</a><span>, in §3.4.6</span>
   <li>
    state
    <ul>
     <li><a href="#service-worker-state-attribute">attribute for ServiceWorker</a><span>, in §3.1.2</span>
     <li><a href="#dfn-state">dfn for service worker</a><span>, in §2.1</span>
    </ul>
   <li><a href="#service-worker-statechange-event">statechange</a><span>, in §3.6</span>
   <li><a href="#dfn-service-worker-registration-task-queue">task queues</a><span>, in §2.2</span>
   <li><a href="#dom-frametype-top-level">"top-level"</a><span>, in §4.2</span>
   <li>
    type
    <ul>
     <li><a href="#dfn-type">dfn for service worker</a><span>, in §2.1</span>
     <li><a href="#dom-cachebatchoperation-type">dict-member for CacheBatchOperation</a><span>, in §5.4</span>
     <li><a href="#dom-clientqueryoptions-type">dict-member for ClientQueryOptions</a><span>, in §4.3</span>
     <li><a href="#dom-registrationoptions-type">dict-member for RegistrationOptions</a><span>, in §3.4</span>
    </ul>
   <li><a href="#dfn-uninstalling-flag">uninstalling flag</a><span>, in §2.2</span>
   <li><a href="#service-worker-registration-unregister-method">unregister()</a><span>, in §3.2.6</span>
   <li><a href="#service-worker-registration-update-method">update()</a><span>, in §3.2.5</span>
   <li><a href="#service-worker-registration-updatefound-event">updatefound</a><span>, in §3.6</span>
   <li><a href="#client-url-attribute">url</a><span>, in §4.2.1</span>
   <li><a href="#dfn-use">using</a><span>, in §2.4</span>
   <li><a href="#dfn-service-worker-client-visibilitystate">visibility state</a><span>, in §4.2</span>
   <li><a href="#client-visibilitystate-attribute">visibilityState</a><span>, in §4.2.5</span>
   <li><a href="#service-worker-registration-waiting-attribute">waiting</a><span>, in §3.2.2</span>
   <li><a href="#dfn-waiting-worker">waiting worker</a><span>, in §2.2</span>
   <li><a href="#wait-to-respond-flag">wait to respond flag</a><span>, in §4.5</span>
   <li><a href="#extendable-event-waituntil-method">waitUntil(f)</a><span>, in §4.4.1</span>
   <li><a href="#dom-clienttype-window">"window"</a><span>, in §4.3</span>
   <li><a href="#dfn-window-client">window client</a><span>, in §2.3</span>
   <li><a href="#window-client-interface">WindowClient</a><span>, in §4.2</span>
   <li><a href="#dom-clienttype-worker">"worker"</a><span>, in §4.3</span>
   <li><a href="#dfn-worker-client">worker client</a><span>, in §2.3</span>
   <li><a href="#dfn-job-worker-type">worker type</a><span>, in §Unnumbered section</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-enforce">
   <a href="https://w3c.github.io/webappsec-csp/2/#enforce">https://w3c.github.io/webappsec-csp/2/#enforce</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enforce">6.2. Content Security Policy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-monitor">
   <a href="https://w3c.github.io/webappsec-csp/2/#monitor">https://w3c.github.io/webappsec-csp/2/#monitor</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-monitor">6.2. Content Security Policy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-document">
   <a href="https://dom.spec.whatwg.org/#document">https://dom.spec.whatwg.org/#document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-document">4.2.8. navigate(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event">
   <a href="https://dom.spec.whatwg.org/#event">https://dom.spec.whatwg.org/#event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-event①">3.6. Events</a> <a href="#ref-for-event②">(2)</a> <a href="#ref-for-event③">(3)</a>
    <li><a href="#ref-for-event④">4.4. ExtendableEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dictdef-eventinit">
   <a href="https://dom.spec.whatwg.org/#dictdef-eventinit">https://dom.spec.whatwg.org/#dictdef-eventinit</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-eventinit">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-dictdef-eventinit①">4.4. ExtendableEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventtarget">
   <a href="https://dom.spec.whatwg.org/#eventtarget">https://dom.spec.whatwg.org/#eventtarget</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventtarget">3.1. ServiceWorker</a>
    <li><a href="#ref-for-eventtarget①">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-eventtarget②">3.4. ServiceWorkerContainer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-canceled-flag">
   <a href="https://dom.spec.whatwg.org/#canceled-flag">https://dom.spec.whatwg.org/#canceled-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-canceled-flag">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-context-object">
   <a href="https://dom.spec.whatwg.org/#context-object">https://dom.spec.whatwg.org/#context-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-context-object">3.1.3. postMessage(message, transfer)</a> <a href="#ref-for-context-object①">(2)</a>
    <li><a href="#ref-for-context-object②">3.2.5. update()</a> <a href="#ref-for-context-object③">(2)</a>
    <li><a href="#ref-for-context-object④">3.2.6. unregister()</a>
    <li><a href="#ref-for-context-object⑤">3.3. navigator.serviceWorker</a>
    <li><a href="#ref-for-context-object⑥">3.4.1. controller</a>
    <li><a href="#ref-for-context-object⑦">3.4.2. ready</a> <a href="#ref-for-context-object⑧">(2)</a> <a href="#ref-for-context-object⑨">(3)</a> <a href="#ref-for-context-object①⓪">(4)</a> <a href="#ref-for-context-object①①">(5)</a>
    <li><a href="#ref-for-context-object①②">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-context-object①③">(2)</a> <a href="#ref-for-context-object①④">(3)</a>
    <li><a href="#ref-for-context-object①⑤">3.4.4. getRegistration(clientURL)</a> <a href="#ref-for-context-object①⑥">(2)</a>
    <li><a href="#ref-for-context-object①⑦">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-context-object①⑧">3.4.6. startMessages()</a>
    <li><a href="#ref-for-context-object①⑨">3.4.7. Event handlers</a>
    <li><a href="#ref-for-context-object②⓪">4.1.1. clients</a>
    <li><a href="#ref-for-context-object②①">4.2.1. url</a>
    <li><a href="#ref-for-context-object②②">4.2.4. postMessage(message, transfer)</a> <a href="#ref-for-context-object②③">(2)</a>
    <li><a href="#ref-for-context-object②④">4.2.5. visibilityState</a>
    <li><a href="#ref-for-context-object②⑤">4.2.6. focused</a>
    <li><a href="#ref-for-context-object②⑥">4.2.7. focus()</a> <a href="#ref-for-context-object②⑦">(2)</a> <a href="#ref-for-context-object②⑧">(3)</a>
    <li><a href="#ref-for-context-object②⑨">4.2.8. navigate(url)</a> <a href="#ref-for-context-object③⓪">(2)</a> <a href="#ref-for-context-object③①">(3)</a> <a href="#ref-for-context-object③②">(4)</a> <a href="#ref-for-context-object③③">(5)</a>
    <li><a href="#ref-for-context-object③④">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-context-object③⑤">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-context-object③⑥">Batch Cache Operations</a> <a href="#ref-for-context-object③⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-dispatch">
   <a href="https://dom.spec.whatwg.org/#concept-event-dispatch">https://dom.spec.whatwg.org/#concept-event-dispatch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-dispatch">2.5. Task Sources</a> <a href="#ref-for-concept-event-dispatch①">(2)</a>
    <li><a href="#ref-for-concept-event-dispatch②">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-event-dispatch③">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-event-dispatch④">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-concept-event-dispatch⑤">Install</a>
    <li><a href="#ref-for-concept-event-dispatch⑥">Activate</a>
    <li><a href="#ref-for-concept-event-dispatch⑦">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dispatch-flag">
   <a href="https://dom.spec.whatwg.org/#dispatch-flag">https://dom.spec.whatwg.org/#dispatch-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dispatch-flag">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event">
   <a href="https://dom.spec.whatwg.org/#concept-event">https://dom.spec.whatwg.org/#concept-event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event">4.5.2. event.clientId</a>
    <li><a href="#ref-for-concept-event①">4.5.3. event.isReload</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-event-listener">
   <a href="https://dom.spec.whatwg.org/#concept-event-listener">https://dom.spec.whatwg.org/#concept-event-listener</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-event-listener">2.1. Service Worker</a>
    <li><a href="#ref-for-concept-event-listener①">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-stop-immediate-propagation-flag">
   <a href="https://dom.spec.whatwg.org/#stop-immediate-propagation-flag">https://dom.spec.whatwg.org/#stop-immediate-propagation-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-stop-immediate-propagation-flag">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-stop-propagation-flag">
   <a href="https://dom.spec.whatwg.org/#stop-propagation-flag">https://dom.spec.whatwg.org/#stop-propagation-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-stop-propagation-flag">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ascii-case-insensitive">
   <a href="https://dom.spec.whatwg.org/#ascii-case-insensitive">https://dom.spec.whatwg.org/#ascii-case-insensitive</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ascii-case-insensitive">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-ascii-case-insensitive①">(2)</a> <a href="#ref-for-ascii-case-insensitive②">(3)</a> <a href="#ref-for-ascii-case-insensitive③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-ecmascript-function-objects-call-thisargument-argumentslist">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist">http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-ecmascript-function-objects-call-thisargument-argumentslist">5.5.1. match(request, options)</a> <a href="#ref-for-sec-ecmascript-function-objects-call-thisargument-argumentslist①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-algorithm-conventions">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions">http://www.ecma-international.org/ecma-262/6.0/#sec-algorithm-conventions</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-algorithm-conventions">Run Job</a>
    <li><a href="#ref-for-sec-algorithm-conventions①">Finish Job</a>
    <li><a href="#ref-for-sec-algorithm-conventions②">Install</a>
    <li><a href="#ref-for-sec-algorithm-conventions③">Handle Functional Event</a> <a href="#ref-for-sec-algorithm-conventions④">(2)</a>
    <li><a href="#ref-for-sec-algorithm-conventions⑤">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-list-and-record-specification-type">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type">http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-list-and-record-specification-type">2.1. Service Worker</a> <a href="#ref-for-sec-list-and-record-specification-type①">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type②">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type③">5.1. Constructs</a> <a href="#ref-for-sec-list-and-record-specification-type④">(2)</a> <a href="#ref-for-sec-list-and-record-specification-type⑤">(3)</a> <a href="#ref-for-sec-list-and-record-specification-type⑥">(4)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type⑦">5.5.1. match(request, options)</a> <a href="#ref-for-sec-list-and-record-specification-type⑧">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type⑨">5.5.2. has(cacheName)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⓪">5.5.3. open(cacheName)</a> <a href="#ref-for-sec-list-and-record-specification-type①①">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①②">5.5.4. delete(cacheName)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①③">5.5.5. keys()</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①④">Appendix A: Algorithms</a> <a href="#ref-for-sec-list-and-record-specification-type①⑤">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑥">Handle Functional Event</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑦">Handle User Agent Shutdown</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑧">Set Registration</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑨">Clear Registration</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type②⓪">Get Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-map-objects">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects">http://www.ecma-international.org/ecma-262/6.0/#sec-map-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-map-objects">5.4. Cache</a>
    <li><a href="#ref-for-sec-map-objects①">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-promise-objects">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects">http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-promise-objects">3.2.5. update()</a>
    <li><a href="#ref-for-sec-promise-objects①">3.2.6. unregister()</a>
    <li><a href="#ref-for-sec-promise-objects②">3.4. ServiceWorkerContainer</a> <a href="#ref-for-sec-promise-objects③">(2)</a>
    <li><a href="#ref-for-sec-promise-objects④">3.4.2. ready</a> <a href="#ref-for-sec-promise-objects⑤">(2)</a>
    <li><a href="#ref-for-sec-promise-objects⑥">3.4.3. register(scriptURL, options)</a>
    <li><a href="#ref-for-sec-promise-objects⑦">3.4.4. getRegistration(clientURL)</a> <a href="#ref-for-sec-promise-objects⑧">(2)</a>
    <li><a href="#ref-for-sec-promise-objects⑨">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-sec-promise-objects①⓪">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-sec-promise-objects①①">4.2.7. focus()</a> <a href="#ref-for-sec-promise-objects①②">(2)</a>
    <li><a href="#ref-for-sec-promise-objects①③">4.2.8. navigate(url)</a> <a href="#ref-for-sec-promise-objects①④">(2)</a> <a href="#ref-for-sec-promise-objects①⑤">(3)</a> <a href="#ref-for-sec-promise-objects①⑥">(4)</a>
    <li><a href="#ref-for-sec-promise-objects①⑦">4.3.1. get(id)</a>
    <li><a href="#ref-for-sec-promise-objects①⑧">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-sec-promise-objects①⑨">4.3.3. openWindow(url)</a> <a href="#ref-for-sec-promise-objects②⓪">(2)</a> <a href="#ref-for-sec-promise-objects②①">(3)</a> <a href="#ref-for-sec-promise-objects②②">(4)</a>
    <li><a href="#ref-for-sec-promise-objects②③">4.3.4. claim()</a> <a href="#ref-for-sec-promise-objects②④">(2)</a>
    <li><a href="#ref-for-sec-promise-objects②⑤">4.4. ExtendableEvent</a> <a href="#ref-for-sec-promise-objects②⑥">(2)</a> <a href="#ref-for-sec-promise-objects②⑦">(3)</a> <a href="#ref-for-sec-promise-objects②⑧">(4)</a> <a href="#ref-for-sec-promise-objects②⑨">(5)</a> <a href="#ref-for-sec-promise-objects③⓪">(6)</a> <a href="#ref-for-sec-promise-objects③①">(7)</a>
    <li><a href="#ref-for-sec-promise-objects③②">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-sec-promise-objects③③">5.4.1. match(request, options)</a>
    <li><a href="#ref-for-sec-promise-objects③④">5.4.2. matchAll(request, options)</a> <a href="#ref-for-sec-promise-objects③⑤">(2)</a> <a href="#ref-for-sec-promise-objects③⑥">(3)</a>
    <li><a href="#ref-for-sec-promise-objects③⑦">5.4.4. addAll(requests)</a> <a href="#ref-for-sec-promise-objects③⑧">(2)</a> <a href="#ref-for-sec-promise-objects③⑨">(3)</a> <a href="#ref-for-sec-promise-objects④⓪">(4)</a>
    <li><a href="#ref-for-sec-promise-objects④①">5.4.5. put(request, response)</a> <a href="#ref-for-sec-promise-objects④②">(2)</a> <a href="#ref-for-sec-promise-objects④③">(3)</a> <a href="#ref-for-sec-promise-objects④④">(4)</a> <a href="#ref-for-sec-promise-objects④⑤">(5)</a>
    <li><a href="#ref-for-sec-promise-objects④⑥">5.4.6. delete(request, options)</a> <a href="#ref-for-sec-promise-objects④⑦">(2)</a>
    <li><a href="#ref-for-sec-promise-objects④⑧">5.4.7. keys(request, options)</a> <a href="#ref-for-sec-promise-objects④⑨">(2)</a>
    <li><a href="#ref-for-sec-promise-objects⑤⓪">5.5.1. match(request, options)</a> <a href="#ref-for-sec-promise-objects⑤①">(2)</a>
    <li><a href="#ref-for-sec-promise-objects⑤②">5.5.2. has(cacheName)</a>
    <li><a href="#ref-for-sec-promise-objects⑤③">5.5.3. open(cacheName)</a>
    <li><a href="#ref-for-sec-promise-objects⑤④">5.5.5. keys()</a>
    <li><a href="#ref-for-sec-promise-objects⑤⑤">Appendix A: Algorithms</a>
    <li><a href="#ref-for-sec-promise-objects⑤⑥">Create Job</a>
    <li><a href="#ref-for-sec-promise-objects⑤⑦">Register</a>
    <li><a href="#ref-for-sec-promise-objects⑤⑧">Update Worker State</a> <a href="#ref-for-sec-promise-objects⑤⑨">(2)</a>
    <li><a href="#ref-for-sec-promise-objects⑥⓪">Batch Cache Operations</a> <a href="#ref-for-sec-promise-objects⑥①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sec-list-and-record-specification-type">
   <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type">http://www.ecma-international.org/ecma-262/6.0/#sec-list-and-record-specification-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sec-list-and-record-specification-type">2.1. Service Worker</a> <a href="#ref-for-sec-list-and-record-specification-type①">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type②">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type③">5.1. Constructs</a> <a href="#ref-for-sec-list-and-record-specification-type④">(2)</a> <a href="#ref-for-sec-list-and-record-specification-type⑤">(3)</a> <a href="#ref-for-sec-list-and-record-specification-type⑥">(4)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type⑦">5.5.1. match(request, options)</a> <a href="#ref-for-sec-list-and-record-specification-type⑧">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type⑨">5.5.2. has(cacheName)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⓪">5.5.3. open(cacheName)</a> <a href="#ref-for-sec-list-and-record-specification-type①①">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①②">5.5.4. delete(cacheName)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①③">5.5.5. keys()</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①④">Appendix A: Algorithms</a> <a href="#ref-for-sec-list-and-record-specification-type①⑤">(2)</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑥">Handle Functional Event</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑦">Handle User Agent Shutdown</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑧">Set Registration</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type①⑨">Clear Registration</a>
    <li><a href="#ref-for-sec-list-and-record-specification-type②⓪">Get Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-headers">
   <a href="https://fetch.spec.whatwg.org/#headers">https://fetch.spec.whatwg.org/#headers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-headers">5.4.4. addAll(requests)</a> <a href="#ref-for-headers①">(2)</a>
    <li><a href="#ref-for-headers②">5.4.5. put(request, response)</a> <a href="#ref-for-headers③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-request">
   <a href="https://fetch.spec.whatwg.org/#request">https://fetch.spec.whatwg.org/#request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-request">4.5. FetchEvent</a> <a href="#ref-for-request①">(2)</a>
    <li><a href="#ref-for-request②">5.1. Constructs</a>
    <li><a href="#ref-for-request③">5.4. Cache</a> <a href="#ref-for-request④">(2)</a>
    <li><a href="#ref-for-request⑤">5.4.2. matchAll(request, options)</a> <a href="#ref-for-request⑥">(2)</a> <a href="#ref-for-request⑦">(3)</a>
    <li><a href="#ref-for-request⑧">5.4.4. addAll(requests)</a> <a href="#ref-for-request⑨">(2)</a> <a href="#ref-for-request①⓪">(3)</a>
    <li><a href="#ref-for-request①①">5.4.5. put(request, response)</a> <a href="#ref-for-request①②">(2)</a> <a href="#ref-for-request①③">(3)</a>
    <li><a href="#ref-for-request①④">5.4.6. delete(request, options)</a> <a href="#ref-for-request①⑤">(2)</a> <a href="#ref-for-request①⑥">(3)</a>
    <li><a href="#ref-for-request①⑦">5.4.7. keys(request, options)</a> <a href="#ref-for-request①⑧">(2)</a> <a href="#ref-for-request①⑨">(3)</a>
    <li><a href="#ref-for-request②⓪">Handle Fetch</a>
    <li><a href="#ref-for-request②①">Query Cache</a> <a href="#ref-for-request②②">(2)</a> <a href="#ref-for-request②③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-requestinfo">
   <a href="https://fetch.spec.whatwg.org/#requestinfo">https://fetch.spec.whatwg.org/#requestinfo</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-requestinfo">5.4. Cache</a> <a href="#ref-for-requestinfo①">(2)</a> <a href="#ref-for-requestinfo②">(3)</a> <a href="#ref-for-requestinfo③">(4)</a> <a href="#ref-for-requestinfo④">(5)</a> <a href="#ref-for-requestinfo⑤">(6)</a> <a href="#ref-for-requestinfo⑥">(7)</a>
    <li><a href="#ref-for-requestinfo⑦">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-response">
   <a href="https://fetch.spec.whatwg.org/#response">https://fetch.spec.whatwg.org/#response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-response">4.5. FetchEvent</a>
    <li><a href="#ref-for-response①">4.5.4. event.respondWith(r)</a> <a href="#ref-for-response②">(2)</a> <a href="#ref-for-response③">(3)</a>
    <li><a href="#ref-for-response④">4.7. Events</a> <a href="#ref-for-response⑤">(2)</a>
    <li><a href="#ref-for-response⑥">5.1. Constructs</a>
    <li><a href="#ref-for-response⑦">5.4. Cache</a> <a href="#ref-for-response⑧">(2)</a> <a href="#ref-for-response⑨">(3)</a>
    <li><a href="#ref-for-response①⓪">5.4.4. addAll(requests)</a> <a href="#ref-for-response①①">(2)</a>
    <li><a href="#ref-for-response①②">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-response①③">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-response①④">(2)</a> <a href="#ref-for-response①⑤">(3)</a>
    <li><a href="#ref-for-response①⑥">Query Cache</a> <a href="#ref-for-response①⑦">(2)</a>
    <li><a href="#ref-for-response①⑧">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-filtered-response-basic">
   <a href="https://fetch.spec.whatwg.org/#concept-filtered-response-basic">https://fetch.spec.whatwg.org/#concept-filtered-response-basic</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-filtered-response-basic">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-concept-filtered-response-basic①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-body">
   <a href="https://fetch.spec.whatwg.org/#concept-response-body">https://fetch.spec.whatwg.org/#concept-response-body</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-body">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-response-body①">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-cache-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-cache-mode">https://fetch.spec.whatwg.org/#concept-request-cache-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-cache-mode">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-cancel-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-cancel-readablestream">https://fetch.spec.whatwg.org/#concept-cancel-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-cancel-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-client">
   <a href="https://fetch.spec.whatwg.org/#concept-request-client">https://fetch.spec.whatwg.org/#concept-request-client</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-client">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-concept-request-client①">Handle Fetch</a> <a href="#ref-for-concept-request-client②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-close-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-close-readablestream">https://fetch.spec.whatwg.org/#concept-close-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-close-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-construct-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-construct-readablestream">https://fetch.spec.whatwg.org/#concept-construct-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-construct-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-filtered-response-cors">
   <a href="https://fetch.spec.whatwg.org/#concept-filtered-response-cors">https://fetch.spec.whatwg.org/#concept-filtered-response-cors</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-filtered-response-cors">6.4. Cross-Origin Resources and CORS</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-destination">
   <a href="https://fetch.spec.whatwg.org/#concept-request-destination">https://fetch.spec.whatwg.org/#concept-request-destination</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-destination">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-request-destination①">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-disturbed">
   <a href="https://fetch.spec.whatwg.org/#concept-body-disturbed">https://fetch.spec.whatwg.org/#concept-body-disturbed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-disturbed">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-concept-body-disturbed①">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-empty-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-empty-readablestream">https://fetch.spec.whatwg.org/#concept-empty-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-empty-readablestream">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-enqueue-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-enqueue-readablestream">https://fetch.spec.whatwg.org/#concept-enqueue-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-enqueue-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-error-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-error-readablestream">https://fetch.spec.whatwg.org/#concept-error-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-error-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream-errored">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream-errored">https://fetch.spec.whatwg.org/#concept-readablestream-errored</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream-errored">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-extract-mime-type">
   <a href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type">https://fetch.spec.whatwg.org/#concept-header-extract-mime-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-extract-mime-type">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch">https://fetch.spec.whatwg.org/#concept-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch">2.4. Selection and Use</a>
    <li><a href="#ref-for-concept-fetch①">4.5.4. event.respondWith(r)</a> <a href="#ref-for-concept-fetch②">(2)</a> <a href="#ref-for-concept-fetch③">(3)</a> <a href="#ref-for-concept-fetch④">(4)</a>
    <li><a href="#ref-for-concept-fetch⑤">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-fetch⑥">(2)</a>
    <li><a href="#ref-for-concept-fetch⑦">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-concept-fetch⑧">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-concept-fetch⑨">(2)</a>
    <li><a href="#ref-for-concept-fetch①⓪">Update</a>
    <li><a href="#ref-for-concept-fetch①①">Handle Fetch</a>
    <li><a href="#ref-for-concept-fetch①②">Service Worker Script Request</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-global-fetch">
   <a href="https://fetch.spec.whatwg.org/#dom-global-fetch">https://fetch.spec.whatwg.org/#dom-global-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-global-fetch">4.7. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-filtered-response">
   <a href="https://fetch.spec.whatwg.org/#concept-filtered-response">https://fetch.spec.whatwg.org/#concept-filtered-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-filtered-response">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-get-reader">
   <a href="https://fetch.spec.whatwg.org/#concept-get-reader">https://fetch.spec.whatwg.org/#concept-get-reader</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-get-reader">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-concept-get-reader①">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-headers-get">
   <a href="https://fetch.spec.whatwg.org/#dom-headers-get">https://fetch.spec.whatwg.org/#dom-headers-get</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-headers-get">Query Cache</a> <a href="#ref-for-dom-headers-get①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-headers-guard">
   <a href="https://fetch.spec.whatwg.org/#concept-headers-guard">https://fetch.spec.whatwg.org/#concept-headers-guard</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-headers-guard">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-headers-guard①">(2)</a>
    <li><a href="#ref-for-concept-headers-guard②">5.4.5. put(request, response)</a> <a href="#ref-for-concept-headers-guard③">(2)</a>
    <li><a href="#ref-for-concept-headers-guard④">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header">
   <a href="https://fetch.spec.whatwg.org/#concept-header">https://fetch.spec.whatwg.org/#concept-header</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-header①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-concept-header②">Query Cache</a>
    <li><a href="#ref-for-concept-header③">Service Worker Script Request</a>
    <li><a href="#ref-for-concept-header④">Service Worker Script Response</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-header-list">
   <a href="https://fetch.spec.whatwg.org/#concept-response-header-list">https://fetch.spec.whatwg.org/#concept-response-header-list</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-header-list">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-response-header-list①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-concept-response-header-list②">Update</a> <a href="#ref-for-concept-response-header-list③">(2)</a>
    <li><a href="#ref-for-concept-response-header-list④">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-request-headers">
   <a href="https://fetch.spec.whatwg.org/#dom-request-headers">https://fetch.spec.whatwg.org/#dom-request-headers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-request-headers">Handle Fetch</a>
    <li><a href="#ref-for-dom-request-headers①">Query Cache</a> <a href="#ref-for-dom-request-headers②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-http-fetch">
   <a href="https://fetch.spec.whatwg.org/#concept-http-fetch">https://fetch.spec.whatwg.org/#concept-http-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-http-fetch">4.7. Events</a> <a href="#ref-for-concept-http-fetch①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-initiator">
   <a href="https://fetch.spec.whatwg.org/#concept-request-initiator">https://fetch.spec.whatwg.org/#concept-request-initiator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-initiator">5.4.4. addAll(requests)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-locked">
   <a href="https://fetch.spec.whatwg.org/#concept-body-locked">https://fetch.spec.whatwg.org/#concept-body-locked</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-locked">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-concept-body-locked①">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-method">
   <a href="https://fetch.spec.whatwg.org/#concept-request-method">https://fetch.spec.whatwg.org/#concept-request-method</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-method">5.4.2. matchAll(request, options)</a>
    <li><a href="#ref-for-concept-request-method①">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-request-method②">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-concept-request-method③">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-concept-request-method④">5.4.7. keys(request, options)</a>
    <li><a href="#ref-for-concept-request-method⑤">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-name">
   <a href="https://fetch.spec.whatwg.org/#concept-header-name">https://fetch.spec.whatwg.org/#concept-header-name</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-name">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-header-name①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-concept-header-name②">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigation-request">
   <a href="https://fetch.spec.whatwg.org/#navigation-request">https://fetch.spec.whatwg.org/#navigation-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigation-request">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-network-error">
   <a href="https://fetch.spec.whatwg.org/#concept-network-error">https://fetch.spec.whatwg.org/#concept-network-error</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-network-error">4.5.4. event.respondWith(r)</a> <a href="#ref-for-concept-network-error①">(2)</a>
    <li><a href="#ref-for-concept-network-error②">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-concept-network-error③">Update</a> <a href="#ref-for-concept-network-error④">(2)</a> <a href="#ref-for-concept-network-error⑤">(3)</a>
    <li><a href="#ref-for-concept-network-error⑥">Handle Fetch</a> <a href="#ref-for-concept-network-error⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-non-subresource-request">
   <a href="https://fetch.spec.whatwg.org/#non-subresource-request">https://fetch.spec.whatwg.org/#non-subresource-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-non-subresource-request">2.4. Selection and Use</a>
    <li><a href="#ref-for-non-subresource-request①">Handle Fetch</a> <a href="#ref-for-non-subresource-request②">(2)</a> <a href="#ref-for-non-subresource-request③">(3)</a> <a href="#ref-for-non-subresource-request④">(4)</a> <a href="#ref-for-non-subresource-request⑤">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-ok-status">
   <a href="https://fetch.spec.whatwg.org/#ok-status">https://fetch.spec.whatwg.org/#ok-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-ok-status">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-ok-status①">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-filtered-response-opaque">
   <a href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque">https://fetch.spec.whatwg.org/#concept-filtered-response-opaque</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-filtered-response-opaque">6.4. Cross-Origin Resources and CORS</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-header-parse">
   <a href="https://fetch.spec.whatwg.org/#concept-header-parse">https://fetch.spec.whatwg.org/#concept-header-parse</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-header-parse">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-potential-navigation-or-subresource-request">
   <a href="https://fetch.spec.whatwg.org/#potential-navigation-or-subresource-request">https://fetch.spec.whatwg.org/#potential-navigation-or-subresource-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-potential-navigation-or-subresource-request">6.5. Implementer Concerns</a>
    <li><a href="#ref-for-potential-navigation-or-subresource-request①">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-process-response">
   <a href="https://fetch.spec.whatwg.org/#process-response">https://fetch.spec.whatwg.org/#process-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-process-response">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-process-response①">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-process-response-end-of-file">
   <a href="https://fetch.spec.whatwg.org/#process-response-end-of-file">https://fetch.spec.whatwg.org/#process-response-end-of-file</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-process-response-end-of-file">5.4.4. addAll(requests)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-read-chunk-from-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream">https://fetch.spec.whatwg.org/#concept-read-chunk-from-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-read-chunk-from-readablestream">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-read-all-bytes-from-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream">https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-read-all-bytes-from-readablestream">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-readablestream">
   <a href="https://fetch.spec.whatwg.org/#concept-readablestream">https://fetch.spec.whatwg.org/#concept-readablestream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-readablestream">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-redirect-mode">
   <a href="https://fetch.spec.whatwg.org/#concept-request-redirect-mode">https://fetch.spec.whatwg.org/#concept-request-redirect-mode</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-redirect-mode">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-request">
   <a href="https://fetch.spec.whatwg.org/#concept-request-request">https://fetch.spec.whatwg.org/#concept-request-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-request">5.4.2. matchAll(request, options)</a> <a href="#ref-for-concept-request-request①">(2)</a>
    <li><a href="#ref-for-concept-request-request②">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-request-request③">(2)</a>
    <li><a href="#ref-for-concept-request-request④">5.4.5. put(request, response)</a> <a href="#ref-for-concept-request-request⑤">(2)</a>
    <li><a href="#ref-for-concept-request-request⑥">5.4.6. delete(request, options)</a> <a href="#ref-for-concept-request-request⑦">(2)</a>
    <li><a href="#ref-for-concept-request-request⑧">5.4.7. keys(request, options)</a> <a href="#ref-for-concept-request-request⑨">(2)</a>
    <li><a href="#ref-for-concept-request-request①⓪">Query Cache</a> <a href="#ref-for-concept-request-request①①">(2)</a> <a href="#ref-for-concept-request-request①②">(3)</a> <a href="#ref-for-concept-request-request①③">(4)</a>
    <li><a href="#ref-for-concept-request-request①④">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-response">
   <a href="https://fetch.spec.whatwg.org/#concept-response-response">https://fetch.spec.whatwg.org/#concept-response-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-response">2.1. Service Worker</a>
    <li><a href="#termref-for-">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-concept-response-response①">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-response-response②">5.4.5. put(request, response)</a> <a href="#termref-for-">(2)</a> <a href="#ref-for-concept-response-response③">(3)</a>
    <li><a href="#ref-for-concept-response-response④">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-concept-response-response⑤">(2)</a> <a href="#ref-for-concept-response-response⑥">(3)</a>
    <li><a href="#ref-for-concept-response-response⑦">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-skip-service-worker-flag">
   <a href="https://fetch.spec.whatwg.org/#skip-service-worker-flag">https://fetch.spec.whatwg.org/#skip-service-worker-flag</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-skip-service-worker-flag">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-status">
   <a href="https://fetch.spec.whatwg.org/#concept-response-status">https://fetch.spec.whatwg.org/#concept-response-status</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-status">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-body-stream">
   <a href="https://fetch.spec.whatwg.org/#concept-body-stream">https://fetch.spec.whatwg.org/#concept-body-stream</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-body-stream">4.5.4. event.respondWith(r)</a> <a href="#ref-for-concept-body-stream①">(2)</a> <a href="#ref-for-concept-body-stream②">(3)</a> <a href="#ref-for-concept-body-stream③">(4)</a> <a href="#ref-for-concept-body-stream④">(5)</a>
    <li><a href="#ref-for-concept-body-stream⑤">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-subresource-request">
   <a href="https://fetch.spec.whatwg.org/#subresource-request">https://fetch.spec.whatwg.org/#subresource-request</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-subresource-request">Handle Fetch</a> <a href="#ref-for-subresource-request①">(2)</a> <a href="#ref-for-subresource-request②">(3)</a> <a href="#ref-for-subresource-request③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-fetch-terminate">
   <a href="https://fetch.spec.whatwg.org/#concept-fetch-terminate">https://fetch.spec.whatwg.org/#concept-fetch-terminate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-fetch-terminate">5.4.4. addAll(requests)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-termination-reason">
   <a href="https://fetch.spec.whatwg.org/#concept-response-termination-reason">https://fetch.spec.whatwg.org/#concept-response-termination-reason</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-termination-reason">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-response-termination-reason①">(2)</a>
    <li><a href="#ref-for-concept-response-termination-reason②">5.4.5. put(request, response)</a> <a href="#ref-for-concept-response-termination-reason③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-response-type">
   <a href="https://fetch.spec.whatwg.org/#concept-response-type">https://fetch.spec.whatwg.org/#concept-response-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-response-type">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-concept-response-type①">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-request-url">
   <a href="https://fetch.spec.whatwg.org/#concept-request-url">https://fetch.spec.whatwg.org/#concept-request-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-request-url">2.4. Selection and Use</a> <a href="#ref-for-concept-request-url①">(2)</a> <a href="#ref-for-concept-request-url②">(3)</a>
    <li><a href="#ref-for-concept-request-url③">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-request-url④">(2)</a>
    <li><a href="#ref-for-concept-request-url⑤">5.4.5. put(request, response)</a> <a href="#ref-for-concept-request-url⑥">(2)</a>
    <li><a href="#ref-for-concept-request-url⑦">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-concept-request-url⑧">Handle Fetch</a>
    <li><a href="#ref-for-concept-request-url⑨">Query Cache</a> <a href="#ref-for-concept-request-url①⓪">(2)</a> <a href="#ref-for-concept-request-url①①">(3)</a> <a href="#ref-for-concept-request-url①②">(4)</a>
    <li><a href="#ref-for-concept-request-url①③">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-abstractworker">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#abstractworker">https://html.spec.whatwg.org/multipage/workers.html#abstractworker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-abstractworker">3.1. ServiceWorker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-domcontentloaded">
   <a href="https://html.spec.whatwg.org/multipage/indices.html#event-domcontentloaded">https://html.spec.whatwg.org/multipage/indices.html#event-domcontentloaded</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-domcontentloaded">Run Job</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dedicatedworkerglobalscope">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope">https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dedicatedworkerglobalscope">2.3. Service Worker Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventhandler">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler">https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventhandler">3.1. ServiceWorker</a>
    <li><a href="#ref-for-eventhandler①">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-eventhandler②">3.4. ServiceWorkerContainer</a> <a href="#ref-for-eventhandler③">(2)</a>
    <li><a href="#ref-for-eventhandler④">4.1. ServiceWorkerGlobalScope</a> <a href="#ref-for-eventhandler⑤">(2)</a> <a href="#ref-for-eventhandler⑥">(3)</a> <a href="#ref-for-eventhandler⑦">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-messageport">
   <a href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport">https://html.spec.whatwg.org/multipage/web-messaging.html#messageport</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-messageport">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-messageport①">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-messageport②">(2)</a> <a href="#ref-for-messageport③">(3)</a> <a href="#ref-for-messageport④">(4)</a>
    <li><a href="#ref-for-messageport⑤">3.5.5. event.ports</a>
    <li><a href="#ref-for-messageport⑥">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-messageport⑦">4.6. ExtendableMessageEvent</a> <a href="#ref-for-messageport⑧">(2)</a> <a href="#ref-for-messageport⑨">(3)</a> <a href="#ref-for-messageport①⓪">(4)</a>
    <li><a href="#ref-for-messageport①①">4.6.5. event.ports</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigator">
   <a href="https://html.spec.whatwg.org/multipage/system-state.html#navigator">https://html.spec.whatwg.org/multipage/system-state.html#navigator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigator">3.3. navigator.serviceWorker</a>
    <li><a href="#ref-for-navigator①">3.4. ServiceWorkerContainer</a> <a href="#ref-for-navigator②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-sharedworkerglobalscope">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope">https://html.spec.whatwg.org/multipage/workers.html#sharedworkerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-sharedworkerglobalscope">2.3. Service Worker Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-window">
   <a href="https://html.spec.whatwg.org/multipage/window-object.html#window">https://html.spec.whatwg.org/multipage/window-object.html#window</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-window">2.3. Service Worker Client</a>
    <li><a href="#ref-for-window①">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-window②">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-window③">4.2.8. navigate(url)</a> <a href="#ref-for-window④">(2)</a>
    <li><a href="#ref-for-window⑤">4.3.3. openWindow(url)</a> <a href="#ref-for-window⑥">(2)</a> <a href="#ref-for-window⑦">(3)</a>
    <li><a href="#ref-for-window⑧">5. Caches</a>
    <li><a href="#ref-for-window⑨">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-windoworworkerglobalscope">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope">https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-windoworworkerglobalscope">5.3. self.caches</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-worker">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#worker">https://html.spec.whatwg.org/multipage/workers.html#worker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-worker">4.1. ServiceWorkerGlobalScope</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workerglobalscope">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope">https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workerglobalscope">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-workerglobalscope①">5. Caches</a>
    <li><a href="#ref-for-workerglobalscope②">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workerlocation">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workerlocation">https://html.spec.whatwg.org/multipage/workers.html#workerlocation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workerlocation">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workernavigator">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator">https://html.spec.whatwg.org/multipage/workers.html#workernavigator</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workernavigator">3.3. navigator.serviceWorker</a>
    <li><a href="#ref-for-workernavigator①">3.4. ServiceWorkerContainer</a> <a href="#ref-for-workernavigator②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workertype">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workertype">https://html.spec.whatwg.org/multipage/workers.html#workertype</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workertype">3.4. ServiceWorkerContainer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-about:blank">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#about:blank">https://html.spec.whatwg.org/multipage/infrastructure.html#about:blank</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-about:blank">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-about:blank①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-active-document">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">https://html.spec.whatwg.org/multipage/browsers.html#active-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-active-document">4.2.7. focus()</a> <a href="#ref-for-active-document①">(2)</a>
    <li><a href="#ref-for-active-document②">4.2.8. navigate(url)</a> <a href="#ref-for-active-document③">(2)</a>
    <li><a href="#ref-for-active-document④">4.3.1. get(id)</a> <a href="#ref-for-active-document⑤">(2)</a>
    <li><a href="#ref-for-active-document⑥">4.3.2. matchAll(options)</a> <a href="#ref-for-active-document⑦">(2)</a> <a href="#ref-for-active-document⑧">(3)</a> <a href="#ref-for-active-document⑨">(4)</a> <a href="#ref-for-active-document①⓪">(5)</a> <a href="#ref-for-active-document①①">(6)</a>
    <li><a href="#ref-for-active-document①②">4.3.3. openWindow(url)</a> <a href="#ref-for-active-document①③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-api-base-url">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url">https://html.spec.whatwg.org/multipage/webappapis.html#api-base-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-api-base-url">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-api-base-url①">(2)</a>
    <li><a href="#ref-for-api-base-url②">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-api-base-url③">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-api-base-url④">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-api-base-url⑤">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-api-url-character-encoding">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#api-url-character-encoding">https://html.spec.whatwg.org/multipage/webappapis.html#api-url-character-encoding</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-api-url-character-encoding">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-application-cache">
   <a href="https://html.spec.whatwg.org/multipage/offline.html#application-cache">https://html.spec.whatwg.org/multipage/offline.html#application-cache</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-application-cache">1. Motivations</a>
    <li><a href="#ref-for-application-cache①">Activate</a> <a href="#ref-for-application-cache②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-auxiliary-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#auxiliary-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-auxiliary-browsing-context">4.2.2. frameType</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-browsing-context">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-browsing-context①">4.2.2. frameType</a> <a href="#ref-for-browsing-context②">(2)</a> <a href="#ref-for-browsing-context③">(3)</a>
    <li><a href="#ref-for-browsing-context④">4.2.7. focus()</a>
    <li><a href="#ref-for-browsing-context⑤">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-browsing-context⑥">4.3.1. get(id)</a>
    <li><a href="#ref-for-browsing-context⑦">4.3.2. matchAll(options)</a> <a href="#ref-for-browsing-context⑧">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-classic-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#classic-script">https://html.spec.whatwg.org/multipage/webappapis.html#classic-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-classic-script">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-creation-url">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#creation-url">https://html.spec.whatwg.org/multipage/webappapis.html#creation-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-creation-url">2.4. Selection and Use</a>
    <li><a href="#ref-for-creation-url①">3.4.2. ready</a>
    <li><a href="#ref-for-creation-url②">4.2.1. url</a>
    <li><a href="#ref-for-creation-url③">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-creation-url④">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-creation-url⑤">4.3.4. claim()</a>
    <li><a href="#ref-for-creation-url⑥">Install</a>
    <li><a href="#ref-for-creation-url⑦">Activate</a>
    <li><a href="#ref-for-creation-url⑧">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-discard-a-document">
   <a href="https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document">https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-discard-a-document">4.2.8. navigate(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-manipulation-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source">https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-manipulation-task-source">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dom-manipulation-task-source①">Resolve Job Promise</a> <a href="#ref-for-dom-manipulation-task-source②">(2)</a>
    <li><a href="#ref-for-dom-manipulation-task-source③">Reject Job Promise</a> <a href="#ref-for-dom-manipulation-task-source④">(2)</a>
    <li><a href="#ref-for-dom-manipulation-task-source⑤">Update Registration State</a>
    <li><a href="#ref-for-dom-manipulation-task-source⑥">Update Worker State</a>
    <li><a href="#ref-for-dom-manipulation-task-source⑦">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-environment-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-environment-settings-object">2.3. Service Worker Client</a> <a href="#ref-for-environment-settings-object①">(2)</a>
    <li><a href="#ref-for-environment-settings-object②">3.5.2. event.origin</a>
    <li><a href="#ref-for-environment-settings-object③">4.2.8. navigate(url)</a> <a href="#ref-for-environment-settings-object④">(2)</a>
    <li><a href="#ref-for-environment-settings-object⑤">4.3.3. openWindow(url)</a> <a href="#ref-for-environment-settings-object⑥">(2)</a> <a href="#ref-for-environment-settings-object⑦">(3)</a>
    <li><a href="#ref-for-environment-settings-object⑧">5.5. CacheStorage</a>
    <li><a href="#ref-for-environment-settings-object⑨">Update</a>
    <li><a href="#ref-for-environment-settings-object①⓪">Install</a>
    <li><a href="#ref-for-environment-settings-object①①">Activate</a>
    <li><a href="#ref-for-environment-settings-object①②">Run Service Worker</a>
    <li><a href="#ref-for-environment-settings-object①③">Terminate Service Worker</a>
    <li><a href="#ref-for-environment-settings-object①④">Handle Fetch</a>
    <li><a href="#ref-for-environment-settings-object①⑤">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handlers">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers">https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handlers">3.1.4. Event handler</a> <a href="#ref-for-event-handlers①">(2)</a>
    <li><a href="#ref-for-event-handlers②">3.2.7. Event handler</a> <a href="#ref-for-event-handlers③">(2)</a>
    <li><a href="#ref-for-event-handlers④">3.4.7. Event handlers</a> <a href="#ref-for-event-handlers⑤">(2)</a>
    <li><a href="#ref-for-event-handlers⑥">4.1.4. Event handlers</a> <a href="#ref-for-event-handlers⑦">(2)</a>
    <li><a href="#ref-for-event-handlers⑧">Update Worker State</a> <a href="#ref-for-event-handlers⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-event-type">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-event-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-event-type">3.1.4. Event handler</a> <a href="#ref-for-event-handler-event-type①">(2)</a>
    <li><a href="#ref-for-event-handler-event-type②">3.2.7. Event handler</a> <a href="#ref-for-event-handler-event-type③">(2)</a>
    <li><a href="#ref-for-event-handler-event-type④">3.4.7. Event handlers</a> <a href="#ref-for-event-handler-event-type⑤">(2)</a>
    <li><a href="#ref-for-event-handler-event-type⑥">4.1.4. Event handlers</a> <a href="#ref-for-event-handler-event-type⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-handler-idl-attributes">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes">https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-idl-attributes</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-handler-idl-attributes">3.1.4. Event handler</a>
    <li><a href="#ref-for-event-handler-idl-attributes①">3.2.7. Event handler</a>
    <li><a href="#ref-for-event-handler-idl-attributes②">3.4.7. Event handlers</a>
    <li><a href="#ref-for-event-handler-idl-attributes③">4.1.4. Event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-loop">2.2. Service Worker Registration</a> <a href="#ref-for-event-loop①">(2)</a> <a href="#ref-for-event-loop②">(3)</a> <a href="#ref-for-event-loop③">(4)</a>
    <li><a href="#ref-for-event-loop④">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-event-loop⑤">Run Service Worker</a> <a href="#ref-for-event-loop⑥">(2)</a>
    <li><a href="#ref-for-event-loop⑦">Terminate Service Worker</a> <a href="#ref-for-event-loop⑧">(2)</a>
    <li><a href="#ref-for-event-loop⑨">Handle Fetch</a>
    <li><a href="#ref-for-event-loop①⓪">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-exceptions-enabled">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#exceptions-enabled">https://html.spec.whatwg.org/multipage/browsing-the-web.html#exceptions-enabled</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-exceptions-enabled">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-exceptions-enabled①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fetch-a-classic-worker-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script">https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-a-classic-worker-script">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fetch-a-module-worker-script-tree">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-worker-script-tree">https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-worker-script-tree</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-a-module-worker-script-tree">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fire-a-simple-event">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event">https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-simple-event</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fire-a-simple-event">Install</a>
    <li><a href="#ref-for-fire-a-simple-event①">Update Worker State</a>
    <li><a href="#ref-for-fire-a-simple-event②">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-focusing-steps">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps">https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-focusing-steps">4.2.7. focus()</a>
    <li><a href="#ref-for-focusing-steps①">4.3.2. matchAll(options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-settings-object-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-settings-object-global">2.3. Service Worker Client</a> <a href="#ref-for-concept-settings-object-global①">(2)</a> <a href="#ref-for-concept-settings-object-global②">(3)</a>
    <li><a href="#ref-for-concept-settings-object-global③">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-settings-object-global④">3.2.5. update()</a>
    <li><a href="#ref-for-concept-settings-object-global⑤">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-concept-settings-object-global⑥">4.2.2. frameType</a> <a href="#ref-for-concept-settings-object-global⑦">(2)</a> <a href="#ref-for-concept-settings-object-global⑧">(3)</a>
    <li><a href="#ref-for-concept-settings-object-global⑨">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-settings-object-global①⓪">4.2.7. focus()</a>
    <li><a href="#ref-for-concept-settings-object-global①①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-concept-settings-object-global①②">4.3.1. get(id)</a>
    <li><a href="#ref-for-concept-settings-object-global①③">4.3.2. matchAll(options)</a> <a href="#ref-for-concept-settings-object-global①④">(2)</a>
    <li><a href="#ref-for-concept-settings-object-global①⑤">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-concept-settings-object-global①⑥">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-concept-settings-object-global①⑦">Install</a>
    <li><a href="#ref-for-concept-settings-object-global①⑧">Activate</a> <a href="#ref-for-concept-settings-object-global①⑨">(2)</a>
    <li><a href="#ref-for-concept-settings-object-global②⓪">Run Service Worker</a> <a href="#ref-for-concept-settings-object-global②①">(2)</a>
    <li><a href="#ref-for-concept-settings-object-global②②">Terminate Service Worker</a>
    <li><a href="#ref-for-concept-settings-object-global②③">Handle Fetch</a>
    <li><a href="#ref-for-concept-settings-object-global②④">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-has-focus-steps">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps">https://html.spec.whatwg.org/multipage/interaction.html#has-focus-steps</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-has-focus-steps">4.2.7. focus()</a>
    <li><a href="#ref-for-has-focus-steps①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-has-focus-steps②">4.3.1. get(id)</a>
    <li><a href="#ref-for-has-focus-steps③">4.3.2. matchAll(options)</a> <a href="#ref-for-has-focus-steps④">(2)</a>
    <li><a href="#ref-for-has-focus-steps⑤">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-workerglobalscope-https-state">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-https-state">https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-https-state</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-workerglobalscope-https-state">Run Service Worker</a> <a href="#ref-for-concept-workerglobalscope-https-state①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-import-scripts-into-worker-global-scope">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#import-scripts-into-worker-global-scope">https://html.spec.whatwg.org/multipage/workers.html#import-scripts-into-worker-global-scope</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-import-scripts-into-worker-global-scope">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-workerglobalscope-importscripts">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts">https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-workerglobalscope-importscripts">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-in-parallel">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-in-parallel">3.4.2. ready</a>
    <li><a href="#ref-for-in-parallel①">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-in-parallel②">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-in-parallel③">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-in-parallel④">4.2.7. focus()</a>
    <li><a href="#ref-for-in-parallel⑤">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-in-parallel⑥">4.3.1. get(id)</a>
    <li><a href="#ref-for-in-parallel⑦">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-in-parallel⑧">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-in-parallel⑨">4.3.4. claim()</a>
    <li><a href="#ref-for-in-parallel①⓪">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-in-parallel①①">4.5.4. event.respondWith(r)</a> <a href="#ref-for-in-parallel①②">(2)</a>
    <li><a href="#ref-for-in-parallel①③">5.4.1. match(request, options)</a>
    <li><a href="#ref-for-in-parallel①④">5.4.2. matchAll(request, options)</a>
    <li><a href="#ref-for-in-parallel①⑤">5.4.4. addAll(requests)</a> <a href="#ref-for-in-parallel①⑥">(2)</a> <a href="#ref-for-in-parallel①⑦">(3)</a> <a href="#ref-for-in-parallel①⑧">(4)</a>
    <li><a href="#ref-for-in-parallel①⑨">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-in-parallel②⓪">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-in-parallel②①">5.4.7. keys(request, options)</a>
    <li><a href="#ref-for-in-parallel②②">5.5.1. match(request, options)</a> <a href="#ref-for-in-parallel②③">(2)</a>
    <li><a href="#ref-for-in-parallel②④">5.5.4. delete(cacheName)</a>
    <li><a href="#ref-for-in-parallel②⑤">Run Job</a> <a href="#ref-for-in-parallel②⑥">(2)</a> <a href="#ref-for-in-parallel②⑦">(3)</a>
    <li><a href="#ref-for-in-parallel②⑧">Install</a>
    <li><a href="#ref-for-in-parallel②⑨">Activate</a>
    <li><a href="#ref-for-in-parallel③⓪">Handle Fetch</a> <a href="#ref-for-in-parallel③①">(2)</a> <a href="#ref-for-in-parallel③②">(3)</a> <a href="#ref-for-in-parallel③③">(4)</a>
    <li><a href="#ref-for-in-parallel③④">Handle User Agent Shutdown</a>
    <li><a href="#ref-for-in-parallel③⑤">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-incumbent-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#incumbent-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-incumbent-settings-object">3.1.3. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fetching-scripts-is-top-level">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-top-level">https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-top-level</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetching-scripts-is-top-level">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-list-of-active-timers">
   <a href="https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#list-of-active-timers">https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#list-of-active-timers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-list-of-active-timers">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-event-message">
   <a href="https://html.spec.whatwg.org/multipage/indices.html#event-message">https://html.spec.whatwg.org/multipage/indices.html#event-message</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-event-message">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-event-message①">4.6. ExtendableMessageEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-module-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#module-script">https://html.spec.whatwg.org/multipage/webappapis.html#module-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-module-script">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-navigate">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate">https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigate">3.2.6. unregister()</a>
    <li><a href="#ref-for-navigate①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-navigate②">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-navigate③">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-nested-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-nested-browsing-context">2.4. Selection and Use</a>
    <li><a href="#ref-for-nested-browsing-context①">4.2.2. frameType</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-origin-2">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#origin-2">https://html.spec.whatwg.org/multipage/browsers.html#origin-2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-origin-2">2.1. Service Worker</a>
    <li><a href="#ref-for-origin-2①">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-origin-2②">3.4.4. getRegistration(clientURL)</a> <a href="#ref-for-origin-2③">(2)</a>
    <li><a href="#ref-for-origin-2④">3.4.5. getRegistrations()</a> <a href="#ref-for-origin-2⑤">(2)</a>
    <li><a href="#ref-for-origin-2⑥">3.5.2. event.origin</a>
    <li><a href="#ref-for-origin-2⑦">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-origin-2⑧">4.2.8. navigate(url)</a> <a href="#ref-for-origin-2⑨">(2)</a>
    <li><a href="#ref-for-origin-2①⓪">4.3.1. get(id)</a> <a href="#ref-for-origin-2①①">(2)</a>
    <li><a href="#ref-for-origin-2①②">4.3.2. matchAll(options)</a> <a href="#ref-for-origin-2①③">(2)</a>
    <li><a href="#ref-for-origin-2①④">4.3.3. openWindow(url)</a> <a href="#ref-for-origin-2①⑤">(2)</a>
    <li><a href="#ref-for-origin-2①⑥">4.3.4. claim()</a> <a href="#ref-for-origin-2①⑦">(2)</a>
    <li><a href="#ref-for-origin-2①⑧">4.6.2. event.origin</a>
    <li><a href="#ref-for-origin-2①⑨">5. Caches</a> <a href="#ref-for-origin-2②⓪">(2)</a>
    <li><a href="#ref-for-origin-2②①">5.1. Constructs</a>
    <li><a href="#ref-for-origin-2②②">5.5. CacheStorage</a>
    <li><a href="#ref-for-origin-2②③">6.3.1. Origin restriction</a> <a href="#ref-for-origin-2②④">(2)</a>
    <li><a href="#ref-for-origin-2②⑤">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-origin-2②⑥">(2)</a>
    <li><a href="#ref-for-origin-2②⑦">Register</a> <a href="#ref-for-origin-2②⑧">(2)</a> <a href="#ref-for-origin-2②⑨">(3)</a> <a href="#ref-for-origin-2③⓪">(4)</a> <a href="#ref-for-origin-2③①">(5)</a>
    <li><a href="#ref-for-origin-2③②">Run Service Worker</a> <a href="#ref-for-origin-2③③">(2)</a>
    <li><a href="#ref-for-origin-2③④">Unregister</a> <a href="#ref-for-origin-2③⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-parent-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#parent-browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#parent-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-parent-browsing-context">2.4. Selection and Use</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-fetching-scripts-perform-fetch">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-perform-fetch">https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-perform-fetch</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetching-scripts-perform-fetch">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-fetching-scripts-perform-fetch①">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-queue-a-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-queue-a-task">2.2. Service Worker Registration</a>
    <li><a href="#ref-for-queue-a-task①">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-queue-a-task②">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-queue-a-task③">4.2.7. focus()</a>
    <li><a href="#ref-for-queue-a-task④">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-queue-a-task⑤">4.3.1. get(id)</a>
    <li><a href="#ref-for-queue-a-task⑥">4.3.2. matchAll(options)</a> <a href="#ref-for-queue-a-task⑦">(2)</a>
    <li><a href="#ref-for-queue-a-task⑧">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-queue-a-task⑨">8.4. Request Functional Event Dispatch</a>
    <li><a href="#ref-for-queue-a-task①⓪">Run Job</a>
    <li><a href="#ref-for-queue-a-task①①">Resolve Job Promise</a> <a href="#ref-for-queue-a-task①②">(2)</a>
    <li><a href="#ref-for-queue-a-task①③">Reject Job Promise</a> <a href="#ref-for-queue-a-task①④">(2)</a>
    <li><a href="#ref-for-queue-a-task①⑤">Install</a> <a href="#ref-for-queue-a-task①⑥">(2)</a> <a href="#ref-for-queue-a-task①⑦">(3)</a>
    <li><a href="#ref-for-queue-a-task①⑧">Activate</a>
    <li><a href="#ref-for-queue-a-task①⑨">Run Service Worker</a>
    <li><a href="#ref-for-queue-a-task②⓪">Terminate Service Worker</a>
    <li><a href="#ref-for-queue-a-task②①">Handle Fetch</a>
    <li><a href="#ref-for-queue-a-task②②">Handle Functional Event</a>
    <li><a href="#ref-for-queue-a-task②③">Update Registration State</a> <a href="#ref-for-queue-a-task②④">(2)</a> <a href="#ref-for-queue-a-task②⑤">(3)</a>
    <li><a href="#ref-for-queue-a-task②⑥">Update Worker State</a>
    <li><a href="#ref-for-queue-a-task②⑦">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-realm-execution-context">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#realm-execution-context">https://html.spec.whatwg.org/multipage/webappapis.html#realm-execution-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-realm-execution-context">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-relevant-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-relevant-global">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-concept-relevant-global①">4.2.8. navigate(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-relevant-realm">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm">https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-relevant-realm">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-relevant-realm①">4.5.4. event.respondWith(r)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-relevant-settings-object">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object">https://html.spec.whatwg.org/multipage/webappapis.html#relevant-settings-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-relevant-settings-object">3.2.5. update()</a> <a href="#ref-for-relevant-settings-object①">(2)</a>
    <li><a href="#ref-for-relevant-settings-object②">3.2.6. unregister()</a>
    <li><a href="#ref-for-relevant-settings-object③">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-relevant-settings-object④">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-relevant-settings-object⑤">(2)</a>
    <li><a href="#ref-for-relevant-settings-object⑥">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-relevant-settings-object⑦">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-relevant-settings-object⑧">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-relevant-settings-object⑨">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-relevant-settings-object①⓪">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-relevant-settings-object①①">Update Registration State</a>
    <li><a href="#ref-for-relevant-settings-object①②">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-replacement-enabled">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#replacement-enabled">https://html.spec.whatwg.org/multipage/browsing-the-web.html#replacement-enabled</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-replacement-enabled">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-replacement-enabled①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-browsing-context">2.4. Selection and Use</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-document">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-document">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-responsible-document①">4.3.2. matchAll(options)</a> <a href="#ref-for-responsible-document②">(2)</a>
    <li><a href="#ref-for-responsible-document③">Activate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-responsible-event-loop">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop">https://html.spec.whatwg.org/multipage/webappapis.html#responsible-event-loop</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-responsible-event-loop">4.2.7. focus()</a>
    <li><a href="#ref-for-responsible-event-loop①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-responsible-event-loop②">4.3.2. matchAll(options)</a> <a href="#ref-for-responsible-event-loop③">(2)</a>
    <li><a href="#ref-for-responsible-event-loop④">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-responsible-event-loop⑤">Resolve Job Promise</a> <a href="#ref-for-responsible-event-loop⑥">(2)</a>
    <li><a href="#ref-for-responsible-event-loop⑦">Reject Job Promise</a> <a href="#ref-for-responsible-event-loop⑧">(2)</a>
    <li><a href="#ref-for-responsible-event-loop⑨">Run Service Worker</a> <a href="#ref-for-responsible-event-loop①⓪">(2)</a>
    <li><a href="#ref-for-responsible-event-loop①①">Update Registration State</a>
    <li><a href="#ref-for-responsible-event-loop①②">Update Worker State</a>
    <li><a href="#ref-for-responsible-event-loop①③">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-run-a-classic-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#run-a-classic-script">https://html.spec.whatwg.org/multipage/webappapis.html#run-a-classic-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-run-a-classic-script">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-run-a-module-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#run-a-module-script">https://html.spec.whatwg.org/multipage/webappapis.html#run-a-module-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-run-a-module-script">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-same-origin">
   <a href="https://html.spec.whatwg.org/multipage/origin.html#same-origin">https://html.spec.whatwg.org/multipage/origin.html#same-origin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-same-origin">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-same-origin①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-same-origin②">4.3.1. get(id)</a>
    <li><a href="#ref-for-same-origin③">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-same-origin④">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-same-origin⑤">4.3.4. claim()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-script">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-script">https://html.spec.whatwg.org/multipage/webappapis.html#concept-script</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-script">2.1. Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-shared-workers">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#shared-workers">https://html.spec.whatwg.org/multipage/workers.html#shared-workers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-shared-workers">1. Motivations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-source-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#source-browsing-context">https://html.spec.whatwg.org/multipage/browsing-the-web.html#source-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-source-browsing-context">4.2.8. navigate(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-structuredclonewithtransfer">
   <a href="https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclonewithtransfer">https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclonewithtransfer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-structuredclonewithtransfer">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-structuredclonewithtransfer①">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-task">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-task">https://html.spec.whatwg.org/multipage/webappapis.html#concept-task</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-task">2.2. Service Worker Registration</a> <a href="#ref-for-concept-task①">(2)</a>
    <li><a href="#ref-for-concept-task②">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-task③">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-concept-task④">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-concept-task⑤">8.4. Request Functional Event Dispatch</a>
    <li><a href="#ref-for-concept-task⑥">Install</a>
    <li><a href="#ref-for-concept-task⑦">Run Service Worker</a>
    <li><a href="#ref-for-concept-task⑧">Terminate Service Worker</a> <a href="#ref-for-concept-task⑨">(2)</a> <a href="#ref-for-concept-task①⓪">(3)</a>
    <li><a href="#ref-for-concept-task①①">Update Registration State</a>
    <li><a href="#ref-for-concept-task①②">Update Worker State</a>
    <li><a href="#ref-for-concept-task①③">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-task-queue">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#task-queue">https://html.spec.whatwg.org/multipage/webappapis.html#task-queue</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-task-queue">2.2. Service Worker Registration</a> <a href="#ref-for-task-queue①">(2)</a> <a href="#ref-for-task-queue②">(3)</a>
    <li><a href="#ref-for-task-queue③">Run Service Worker</a>
    <li><a href="#ref-for-task-queue④">Terminate Service Worker</a> <a href="#ref-for-task-queue⑤">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#task-source">https://html.spec.whatwg.org/multipage/webappapis.html#task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-task-source">2.5. Task Sources</a> <a href="#ref-for-task-source①">(2)</a> <a href="#ref-for-task-source②">(3)</a>
    <li><a href="#ref-for-task-source③">3.4. ServiceWorkerContainer</a> <a href="#ref-for-task-source④">(2)</a>
    <li><a href="#ref-for-task-source⑤">Resolve Job Promise</a> <a href="#ref-for-task-source⑥">(2)</a>
    <li><a href="#ref-for-task-source⑦">Reject Job Promise</a> <a href="#ref-for-task-source⑧">(2)</a>
    <li><a href="#ref-for-task-source⑨">Run Service Worker</a>
    <li><a href="#ref-for-task-source①⓪">Terminate Service Worker</a> <a href="#ref-for-task-source①①">(2)</a> <a href="#ref-for-task-source①②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-terminate-a-worker">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#terminate-a-worker">https://html.spec.whatwg.org/multipage/workers.html#terminate-a-worker</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-terminate-a-worker">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-global-object-realm">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-global-object-realm">https://html.spec.whatwg.org/multipage/webappapis.html#concept-global-object-realm</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-global-object-realm">3.1.3. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-realm-global">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global">https://html.spec.whatwg.org/multipage/webappapis.html#concept-realm-global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-realm-global">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-top-level-browsing-context">
   <a href="https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context">https://html.spec.whatwg.org/multipage/browsers.html#top-level-browsing-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-top-level-browsing-context">4.2.2. frameType</a>
    <li><a href="#ref-for-top-level-browsing-context①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-triggered-by-user-activation">
   <a href="https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation">https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-triggered-by-user-activation">4.2.7. focus()</a>
    <li><a href="#ref-for-triggered-by-user-activation①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-workerglobalscope-type">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-type">https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-workerglobalscope-type">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-unload-a-document">
   <a href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#unload-a-document">https://html.spec.whatwg.org/multipage/browsing-the-web.html#unload-a-document</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-unload-a-document">Handle Service Worker Client Unload</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-unsafe-response">
   <a href="https://html.spec.whatwg.org/multipage/urls-and-fetching.html#unsafe-response">https://html.spec.whatwg.org/multipage/urls-and-fetching.html#unsafe-response</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-unsafe-response">6.3.2. importScripts(urls)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-workerglobalscope-url">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-url">https://html.spec.whatwg.org/multipage/workers.html#concept-workerglobalscope-url</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-workerglobalscope-url">Run Service Worker</a> <a href="#ref-for-concept-workerglobalscope-url①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-user-interaction-task-source">
   <a href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source">https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-user-interaction-task-source">4.2.7. focus()</a>
    <li><a href="#ref-for-user-interaction-task-source①">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-user-interaction-task-source②">4.3.2. matchAll(options)</a> <a href="#ref-for-user-interaction-task-source③">(2)</a>
    <li><a href="#ref-for-user-interaction-task-source④">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-workers">
   <a href="https://html.spec.whatwg.org/multipage/workers.html#workers">https://html.spec.whatwg.org/multipage/workers.html#workers</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-workers①">2.1. Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-VisibilityState">
   <a href="https://www.w3.org/TR/page-visibility/#VisibilityState">https://www.w3.org/TR/page-visibility/#VisibilityState</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-VisibilityState">4.2. Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-document-visibilitystate">
   <a href="https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate">https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-document-visibilitystate">4.2. Client</a>
    <li><a href="#ref-for-dom-document-visibilitystate①">4.2.7. focus()</a>
    <li><a href="#ref-for-dom-document-visibilitystate②">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-dom-document-visibilitystate③">4.3.1. get(id)</a>
    <li><a href="#ref-for-dom-document-visibilitystate④">4.3.2. matchAll(options)</a> <a href="#ref-for-dom-document-visibilitystate⑤">(2)</a>
    <li><a href="#ref-for-dom-document-visibilitystate⑥">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-transforming-by">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide#transforming-by">https://www.w3.org/2001/tag/doc/promises-guide#transforming-by</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-transforming-by">5.4.3. add(request)</a>
    <li><a href="#ref-for-transforming-by①">5.4.4. addAll(requests)</a> <a href="#ref-for-transforming-by②">(2)</a> <a href="#ref-for-transforming-by③">(3)</a>
    <li><a href="#ref-for-transforming-by④">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-transforming-by⑤">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-transforming-by⑥">5.5.1. match(request, options)</a>
    <li><a href="#ref-for-transforming-by⑦">5.5.4. delete(cacheName)</a>
    <li><a href="#ref-for-transforming-by⑧">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-waiting-for-all">
   <a href="https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all">https://www.w3.org/2001/tag/doc/promises-guide#waiting-for-all</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-waiting-for-all">5.4.4. addAll(requests)</a> <a href="#ref-for-waiting-for-all①">(2)</a>
    <li><a href="#ref-for-waiting-for-all②">Install</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-widl-ServiceWorkerGlobalScope-onbeforeevicted">
   <a href="http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onbeforeevicted">http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onbeforeevicted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-widl-ServiceWorkerGlobalScope-onbeforeevicted">7. Storage Considerations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-widl-ServiceWorkerGlobalScope-onevicted">
   <a href="http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onevicted">http://www.w3.org/TR/quota-api/#widl-ServiceWorkerGlobalScope-onevicted</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-widl-ServiceWorkerGlobalScope-onevicted">7. Storage Considerations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-3.2">
   <a href="https://tools.ietf.org/html/rfc7230#section-3.2">https://tools.ietf.org/html/rfc7230#section-3.2</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-3.2">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-section-3.2①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-section-3.2②">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-section-7.1.4">
   <a href="https://tools.ietf.org/html/rfc7231#section-7.1.4">https://tools.ietf.org/html/rfc7231#section-7.1.4</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-section-7.1.4">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-section-7.1.4①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-section-7.1.4②">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-is-origin-trustworthy">
   <a href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#is-origin-trustworthy">https://w3c.github.io/webappsec/specs/powerfulfeatures/#is-origin-trustworthy</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-is-origin-trustworthy">Register</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-threat-risks">
   <a href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#threat-risks">https://w3c.github.io/webappsec/specs/powerfulfeatures/#threat-risks</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-threat-risks">6.1. Secure Context</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-secure-context">
   <a href="https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context">https://w3c.github.io/webappsec/specs/powerfulfeatures/#secure-context</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-secure-context">4.3.1. get(id)</a>
    <li><a href="#ref-for-secure-context①">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-secure-context②">4.3.4. claim()</a>
    <li><a href="#ref-for-secure-context③">6.1. Secure Context</a> <a href="#ref-for-secure-context④">(2)</a> <a href="#ref-for-secure-context⑤">(3)</a>
    <li><a href="#ref-for-secure-context⑥">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-equals">
   <a href="https://url.spec.whatwg.org/#concept-url-equals">https://url.spec.whatwg.org/#concept-url-equals</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-equals">Register</a>
    <li><a href="#ref-for-concept-url-equals①">Update</a> <a href="#ref-for-concept-url-equals②">(2)</a>
    <li><a href="#ref-for-concept-url-equals③">Query Cache</a> <a href="#ref-for-concept-url-equals④">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-parser">
   <a href="https://url.spec.whatwg.org/#concept-url-parser">https://url.spec.whatwg.org/#concept-url-parser</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-parser">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-concept-url-parser①">(2)</a> <a href="#ref-for-concept-url-parser②">(3)</a>
    <li><a href="#ref-for-concept-url-parser③">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-concept-url-parser④">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-concept-url-parser⑤">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-concept-url-parser⑥">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-concept-url-parser⑦">Update</a>
    <li><a href="#ref-for-concept-url-parser⑧">Clear Registration</a>
    <li><a href="#ref-for-concept-url-parser⑨">Match Service Worker Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-path">
   <a href="https://url.spec.whatwg.org/#concept-url-path">https://url.spec.whatwg.org/#concept-url-path</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-path">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-concept-url-path①">(2)</a>
    <li><a href="#ref-for-concept-url-path②">Update</a> <a href="#ref-for-concept-url-path③">(2)</a> <a href="#ref-for-concept-url-path④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-query">
   <a href="https://url.spec.whatwg.org/#concept-url-query">https://url.spec.whatwg.org/#concept-url-query</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-query">Query Cache</a> <a href="#ref-for-concept-url-query①">(2)</a> <a href="#ref-for-concept-url-query②">(3)</a> <a href="#ref-for-concept-url-query③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-scheme">
   <a href="https://url.spec.whatwg.org/#concept-url-scheme">https://url.spec.whatwg.org/#concept-url-scheme</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-scheme">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-concept-url-scheme①">(2)</a>
    <li><a href="#ref-for-concept-url-scheme②">5.4.4. addAll(requests)</a> <a href="#ref-for-concept-url-scheme③">(2)</a>
    <li><a href="#ref-for-concept-url-scheme④">5.4.5. put(request, response)</a> <a href="#ref-for-concept-url-scheme⑤">(2)</a>
    <li><a href="#ref-for-concept-url-scheme⑥">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-url-serializer">
   <a href="https://url.spec.whatwg.org/#concept-url-serializer">https://url.spec.whatwg.org/#concept-url-serializer</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-url-serializer">3.1.1. scriptURL</a>
    <li><a href="#ref-for-concept-url-serializer①">3.2.4. scope</a>
    <li><a href="#ref-for-concept-url-serializer②">4.2.1. url</a>
    <li><a href="#ref-for-concept-url-serializer③">Update</a> <a href="#ref-for-concept-url-serializer④">(2)</a>
    <li><a href="#ref-for-concept-url-serializer⑤">Set Registration</a>
    <li><a href="#ref-for-concept-url-serializer⑥">Match Service Worker Registration</a>
    <li><a href="#ref-for-concept-url-serializer⑦">Get Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-DOMString">
   <a href="https://heycam.github.io/webidl/#idl-DOMString">https://heycam.github.io/webidl/#idl-DOMString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-DOMString">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-idl-DOMString①">(2)</a> <a href="#ref-for-idl-DOMString②">(3)</a> <a href="#ref-for-idl-DOMString③">(4)</a> <a href="#ref-for-idl-DOMString④">(5)</a>
    <li><a href="#ref-for-idl-DOMString⑤">4.2. Client</a>
    <li><a href="#ref-for-idl-DOMString⑥">4.3. Clients</a>
    <li><a href="#ref-for-idl-DOMString⑦">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-idl-DOMString⑧">4.5. FetchEvent</a> <a href="#ref-for-idl-DOMString⑨">(2)</a> <a href="#ref-for-idl-DOMString①⓪">(3)</a>
    <li><a href="#ref-for-idl-DOMString①①">4.6. ExtendableMessageEvent</a> <a href="#ref-for-idl-DOMString①②">(2)</a> <a href="#ref-for-idl-DOMString①③">(3)</a> <a href="#ref-for-idl-DOMString①④">(4)</a> <a href="#ref-for-idl-DOMString①⑤">(5)</a>
    <li><a href="#ref-for-idl-DOMString①⑥">5.4. Cache</a> <a href="#ref-for-idl-DOMString①⑦">(2)</a>
    <li><a href="#ref-for-idl-DOMString①⑧">5.5. CacheStorage</a> <a href="#ref-for-idl-DOMString①⑨">(2)</a> <a href="#ref-for-idl-DOMString②⓪">(3)</a> <a href="#ref-for-idl-DOMString②①">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Exposed">
   <a href="https://heycam.github.io/webidl/#Exposed">https://heycam.github.io/webidl/#Exposed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Exposed">3.1. ServiceWorker</a>
    <li><a href="#ref-for-Exposed①">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-Exposed②">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-Exposed③">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-Exposed④">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-Exposed⑤">4.2. Client</a> <a href="#ref-for-Exposed⑥">(2)</a>
    <li><a href="#ref-for-Exposed⑦">4.3. Clients</a>
    <li><a href="#ref-for-Exposed⑧">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-Exposed⑨">4.5. FetchEvent</a>
    <li><a href="#ref-for-Exposed①⓪">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-Exposed①①">5.4. Cache</a>
    <li><a href="#ref-for-Exposed①②">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-Global">
   <a href="https://heycam.github.io/webidl/#Global">https://heycam.github.io/webidl/#Global</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-Global">4.1. ServiceWorkerGlobalScope</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidaccesserror">
   <a href="https://heycam.github.io/webidl/#invalidaccesserror">https://heycam.github.io/webidl/#invalidaccesserror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidaccesserror">4.2.7. focus()</a>
    <li><a href="#ref-for-invalidaccesserror①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-invalidstateerror">
   <a href="https://heycam.github.io/webidl/#invalidstateerror">https://heycam.github.io/webidl/#invalidstateerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-invalidstateerror">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-invalidstateerror①">3.2.5. update()</a> <a href="#ref-for-invalidstateerror②">(2)</a>
    <li><a href="#ref-for-invalidstateerror③">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-invalidstateerror④">4.3.4. claim()</a>
    <li><a href="#ref-for-invalidstateerror⑤">4.4.1. event.waitUntil(f)</a>
    <li><a href="#ref-for-invalidstateerror⑥">4.5.4. event.respondWith(r)</a> <a href="#ref-for-invalidstateerror⑦">(2)</a>
    <li><a href="#ref-for-invalidstateerror⑧">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-NewObject">
   <a href="https://heycam.github.io/webidl/#NewObject">https://heycam.github.io/webidl/#NewObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-NewObject">3.2. ServiceWorkerRegistration</a> <a href="#ref-for-NewObject①">(2)</a>
    <li><a href="#ref-for-NewObject②">3.4. ServiceWorkerContainer</a> <a href="#ref-for-NewObject③">(2)</a> <a href="#ref-for-NewObject④">(3)</a>
    <li><a href="#ref-for-NewObject⑤">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-NewObject⑥">4.2. Client</a> <a href="#ref-for-NewObject⑦">(2)</a>
    <li><a href="#ref-for-NewObject⑧">4.3. Clients</a> <a href="#ref-for-NewObject⑨">(2)</a> <a href="#ref-for-NewObject①⓪">(3)</a> <a href="#ref-for-NewObject①①">(4)</a>
    <li><a href="#ref-for-NewObject①②">5.4. Cache</a> <a href="#ref-for-NewObject①③">(2)</a> <a href="#ref-for-NewObject①④">(3)</a> <a href="#ref-for-NewObject①⑤">(4)</a> <a href="#ref-for-NewObject①⑥">(5)</a> <a href="#ref-for-NewObject①⑦">(6)</a> <a href="#ref-for-NewObject①⑧">(7)</a>
    <li><a href="#ref-for-NewObject①⑨">5.5. CacheStorage</a> <a href="#ref-for-NewObject②⓪">(2)</a> <a href="#ref-for-NewObject②①">(3)</a> <a href="#ref-for-NewObject②②">(4)</a> <a href="#ref-for-NewObject②③">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-quotaexceedederror">
   <a href="https://heycam.github.io/webidl/#quotaexceedederror">https://heycam.github.io/webidl/#quotaexceedederror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-quotaexceedederror">5.5.3. open(cacheName)</a>
    <li><a href="#ref-for-quotaexceedederror①">7. Storage Considerations</a>
    <li><a href="#ref-for-quotaexceedederror②">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SameObject">
   <a href="https://heycam.github.io/webidl/#SameObject">https://heycam.github.io/webidl/#SameObject</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SameObject">3.3. navigator.serviceWorker</a> <a href="#ref-for-SameObject①">(2)</a>
    <li><a href="#ref-for-SameObject②">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-SameObject③">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-SameObject④">4.1. ServiceWorkerGlobalScope</a> <a href="#ref-for-SameObject⑤">(2)</a>
    <li><a href="#ref-for-SameObject⑥">4.5. FetchEvent</a>
    <li><a href="#ref-for-SameObject⑦">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-SameObject⑧">5.3. self.caches</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-SecureContext">
   <a href="https://heycam.github.io/webidl/#SecureContext">https://heycam.github.io/webidl/#SecureContext</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-SecureContext">3.1. ServiceWorker</a>
    <li><a href="#ref-for-SecureContext①">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-SecureContext②">3.3. navigator.serviceWorker</a> <a href="#ref-for-SecureContext③">(2)</a>
    <li><a href="#ref-for-SecureContext④">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-SecureContext⑤">5.3. self.caches</a>
    <li><a href="#ref-for-SecureContext⑥">5.4. Cache</a>
    <li><a href="#ref-for-SecureContext⑦">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-securityerror">
   <a href="https://heycam.github.io/webidl/#securityerror">https://heycam.github.io/webidl/#securityerror</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-securityerror">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-securityerror①">4.3.1. get(id)</a>
    <li><a href="#ref-for-securityerror②">Register</a> <a href="#ref-for-securityerror③">(2)</a> <a href="#ref-for-securityerror④">(3)</a>
    <li><a href="#ref-for-securityerror⑤">Update</a> <a href="#ref-for-securityerror⑥">(2)</a> <a href="#ref-for-securityerror⑦">(3)</a>
    <li><a href="#ref-for-securityerror⑧">Unregister</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-USVString">
   <a href="https://heycam.github.io/webidl/#idl-USVString">https://heycam.github.io/webidl/#idl-USVString</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-USVString">3.1. ServiceWorker</a>
    <li><a href="#ref-for-idl-USVString①">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-idl-USVString②">3.4. ServiceWorkerContainer</a> <a href="#ref-for-idl-USVString③">(2)</a> <a href="#ref-for-idl-USVString④">(3)</a>
    <li><a href="#ref-for-idl-USVString⑤">4.2. Client</a> <a href="#ref-for-idl-USVString⑥">(2)</a>
    <li><a href="#ref-for-idl-USVString⑦">4.3. Clients</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-boolean">
   <a href="https://heycam.github.io/webidl/#idl-boolean">https://heycam.github.io/webidl/#idl-boolean</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-boolean">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-idl-boolean①">4.2. Client</a>
    <li><a href="#ref-for-idl-boolean②">4.3. Clients</a>
    <li><a href="#ref-for-idl-boolean③">4.5. FetchEvent</a> <a href="#ref-for-idl-boolean④">(2)</a>
    <li><a href="#ref-for-idl-boolean⑤">5.4. Cache</a> <a href="#ref-for-idl-boolean⑥">(2)</a> <a href="#ref-for-idl-boolean⑦">(3)</a> <a href="#ref-for-idl-boolean⑧">(4)</a>
    <li><a href="#ref-for-idl-boolean⑨">5.5. CacheStorage</a> <a href="#ref-for-idl-boolean①⓪">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-exception">
   <a href="https://www.w3.org/TR/WebIDL/#dfn-exception">https://www.w3.org/TR/WebIDL/#dfn-exception</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-exception">Reject Job Promise</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-frozen-array-type">
   <a href="https://heycam.github.io/webidl/#dfn-frozen-array-type">https://heycam.github.io/webidl/#dfn-frozen-array-type</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-frozen-array-type">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-frozen-array-type①">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-idl-object">
   <a href="https://heycam.github.io/webidl/#idl-object">https://heycam.github.io/webidl/#idl-object</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-idl-object">3.1. ServiceWorker</a>
    <li><a href="#ref-for-idl-object①">4.2. Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-partial-interface">
   <a href="https://www.w3.org/TR/WebIDL/#dfn-partial-interface">https://www.w3.org/TR/WebIDL/#dfn-partial-interface</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-partial-interface">8.1. Define API bound to Service Worker Registration</a>
    <li><a href="#ref-for-dfn-partial-interface①">8.3. Define Event Handler</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-present">
   <a href="https://www.w3.org/TR/WebIDL/#dfn-present">https://www.w3.org/TR/WebIDL/#dfn-present</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-present">3.4.3. register(scriptURL, options)</a>
    <li><a href="#ref-for-dfn-present①">5.5.1. match(request, options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dfn-throw">
   <a href="https://heycam.github.io/webidl/#dfn-throw">https://heycam.github.io/webidl/#dfn-throw</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-throw">3.1.3. postMessage(message, transfer)</a> <a href="#ref-for-dfn-throw①">(2)</a> <a href="#ref-for-dfn-throw②">(3)</a>
    <li><a href="#ref-for-dfn-throw③">4.2.4. postMessage(message, transfer)</a> <a href="#ref-for-dfn-throw④">(2)</a> <a href="#ref-for-dfn-throw⑤">(3)</a>
    <li><a href="#ref-for-dfn-throw⑥">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-dfn-throw⑦">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-dfn-throw⑧">4.4.1. event.waitUntil(f)</a>
    <li><a href="#ref-for-dfn-throw⑨">4.5.4. event.respondWith(r)</a> <a href="#ref-for-dfn-throw①⓪">(2)</a>
    <li><a href="#ref-for-dfn-throw①①">5.4.2. matchAll(request, options)</a>
    <li><a href="#ref-for-dfn-throw①②">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-dfn-throw①③">5.4.5. put(request, response)</a> <a href="#ref-for-dfn-throw①④">(2)</a>
    <li><a href="#ref-for-dfn-throw①⑤">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-dfn-throw①⑥">5.4.7. keys(request, options)</a>
    <li><a href="#ref-for-dfn-throw①⑦">Batch Cache Operations</a> <a href="#ref-for-dfn-throw①⑧">(2)</a> <a href="#ref-for-dfn-throw①⑨">(3)</a> <a href="#ref-for-dfn-throw②⓪">(4)</a> <a href="#ref-for-dfn-throw②①">(5)</a> <a href="#ref-for-dfn-throw②②">(6)</a> <a href="#ref-for-dfn-throw②③">(7)</a> <a href="#ref-for-dfn-throw②④">(8)</a> <a href="#ref-for-dfn-throw②⑤">(9)</a> <a href="#ref-for-dfn-throw②⑥">(10)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[CSP2]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-enforce" style="color:initial">enforce</span>
     <li><span class="dfn-paneled" id="term-for-monitor" style="color:initial">monitor</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-document" style="color:initial">Document</span>
     <li><span class="dfn-paneled" id="term-for-event" style="color:initial">Event</span>
     <li><span class="dfn-paneled" id="term-for-dictdef-eventinit" style="color:initial">EventInit</span>
     <li><span class="dfn-paneled" id="term-for-eventtarget" style="color:initial">EventTarget</span>
     <li><span class="dfn-paneled" id="term-for-canceled-flag" style="color:initial">canceled flag</span>
     <li><span class="dfn-paneled" id="term-for-context-object" style="color:initial">context object</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-dispatch" style="color:initial">dispatch</span>
     <li><span class="dfn-paneled" id="term-for-dispatch-flag" style="color:initial">dispatch flag</span>
     <li><span class="dfn-paneled" id="term-for-concept-event" style="color:initial">event</span>
     <li><span class="dfn-paneled" id="term-for-concept-event-listener" style="color:initial">event listener</span>
     <li><span class="dfn-paneled" id="term-for-stop-immediate-propagation-flag" style="color:initial">stop immediate propagation flag</span>
     <li><span class="dfn-paneled" id="term-for-stop-propagation-flag" style="color:initial">stop propagation flag</span>
    </ul>
   <li>
    <a data-link-type="biblio">[dom-ls]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-ascii-case-insensitive" style="color:initial">ascii case-insensitive</span>
    </ul>
   <li>
    <a data-link-type="biblio">[ECMASCRIPT]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-sec-ecmascript-function-objects-call-thisargument-argumentslist" style="color:initial">[[call]]</span>
     <li><span class="dfn-paneled" id="term-for-sec-algorithm-conventions" style="color:initial">assert</span>
     <li><span class="dfn-paneled" id="term-for-sec-list-and-record-specification-type" style="color:initial">list</span>
     <li><span class="dfn-paneled" id="term-for-sec-map-objects" style="color:initial">map objects</span>
     <li><span class="dfn-paneled" id="term-for-sec-promise-objects" style="color:initial">promise</span>
     <li><span class="dfn-paneled" id="term-for-sec-list-and-record-specification-type①" style="color:initial">record</span>
    </ul>
   <li>
    <a data-link-type="biblio">[FETCH]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-headers" style="color:initial">Headers</span>
     <li><span class="dfn-paneled" id="term-for-request" style="color:initial">Request</span>
     <li><span class="dfn-paneled" id="term-for-requestinfo" style="color:initial">RequestInfo</span>
     <li><span class="dfn-paneled" id="term-for-response" style="color:initial">Response</span>
     <li><span class="dfn-paneled" id="term-for-concept-filtered-response-basic" style="color:initial">basic filtered response</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-body" style="color:initial">body</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-cache-mode" style="color:initial">cache mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-cancel-readablestream" style="color:initial">cancel a readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-client" style="color:initial">client</span>
     <li><span class="dfn-paneled" id="term-for-concept-close-readablestream" style="color:initial">close readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-construct-readablestream" style="color:initial">construct a readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-filtered-response-cors" style="color:initial">cors filtered response</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-destination" style="color:initial">destination</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-disturbed" style="color:initial">disturbed</span>
     <li><span class="dfn-paneled" id="term-for-concept-empty-readablestream" style="color:initial">empty</span>
     <li><span class="dfn-paneled" id="term-for-concept-enqueue-readablestream" style="color:initial">enqueue a chunk to readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-error-readablestream" style="color:initial">error readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream-errored" style="color:initial">errored</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-extract-mime-type" style="color:initial">extract a mime type</span>
     <li><span class="dfn-paneled" id="term-for-concept-fetch" style="color:initial">fetch</span>
     <li><span class="dfn-paneled" id="term-for-dom-global-fetch" style="color:initial">fetch(input, init)</span>
     <li><span class="dfn-paneled" id="term-for-concept-filtered-response" style="color:initial">filtered response</span>
     <li><span class="dfn-paneled" id="term-for-concept-get-reader" style="color:initial">get a reader</span>
     <li><span class="dfn-paneled" id="term-for-dom-headers-get" style="color:initial">get(name)</span>
     <li><span class="dfn-paneled" id="term-for-concept-headers-guard" style="color:initial">guard</span>
     <li><span class="dfn-paneled" id="term-for-concept-header" style="color:initial">header</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-header-list" style="color:initial">header list <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-dom-request-headers" style="color:initial">headers</span>
     <li><span class="dfn-paneled" id="term-for-concept-http-fetch" style="color:initial">http fetch</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-initiator" style="color:initial">initiator</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-locked" style="color:initial">locked</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-method" style="color:initial">method</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-name" style="color:initial">name</span>
     <li><span class="dfn-paneled" id="term-for-navigation-request" style="color:initial">navigation request</span>
     <li><span class="dfn-paneled" id="term-for-concept-network-error" style="color:initial">network error</span>
     <li><span class="dfn-paneled" id="term-for-non-subresource-request" style="color:initial">non-subresource request</span>
     <li><span class="dfn-paneled" id="term-for-ok-status" style="color:initial">ok status</span>
     <li><span class="dfn-paneled" id="term-for-concept-filtered-response-opaque" style="color:initial">opaque filtered response</span>
     <li><span class="dfn-paneled" id="term-for-concept-header-parse" style="color:initial">parsing</span>
     <li><span class="dfn-paneled" id="term-for-potential-navigation-or-subresource-request" style="color:initial">potential-navigation-or-subresource request</span>
     <li><span class="dfn-paneled" id="term-for-process-response" style="color:initial">process response</span>
     <li><span class="dfn-paneled" id="term-for-process-response-end-of-file" style="color:initial">process response end-of-file</span>
     <li><span class="dfn-paneled" id="term-for-concept-read-chunk-from-readablestream" style="color:initial">read a chunk from a readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-read-all-bytes-from-readablestream" style="color:initial">read all bytes</span>
     <li><span class="dfn-paneled" id="term-for-concept-readablestream" style="color:initial">readablestream</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-redirect-mode" style="color:initial">redirect mode</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-request" style="color:initial">request <small>(for request)</small></span>
     <li><span class="dfn-paneled" id="term-for-concept-response-response" style="color:initial">response <small>(for response)</small></span>
     <li><span class="dfn-paneled" id="term-for-skip-service-worker-flag" style="color:initial">skip service worker flag</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-status" style="color:initial">status</span>
     <li><span class="dfn-paneled" id="term-for-concept-body-stream" style="color:initial">stream</span>
     <li><span class="dfn-paneled" id="term-for-subresource-request" style="color:initial">subresource request</span>
     <li><span class="dfn-paneled" id="term-for-concept-fetch-terminate" style="color:initial">terminate</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-termination-reason" style="color:initial">termination reason</span>
     <li><span class="dfn-paneled" id="term-for-concept-response-type" style="color:initial">type</span>
     <li><span class="dfn-paneled" id="term-for-concept-request-url" style="color:initial">url</span>
    </ul>
   <li>
    <a data-link-type="biblio">[HTML]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-abstractworker" style="color:initial">AbstractWorker</span>
     <li><span class="dfn-paneled" id="term-for-event-domcontentloaded" style="color:initial">DOMContentLoaded</span>
     <li><span class="dfn-paneled" id="term-for-dedicatedworkerglobalscope" style="color:initial">DedicatedWorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-eventhandler" style="color:initial">EventHandler</span>
     <li><span class="dfn-paneled" id="term-for-messageport" style="color:initial">MessagePort</span>
     <li><span class="dfn-paneled" id="term-for-navigator" style="color:initial">Navigator</span>
     <li><span class="dfn-paneled" id="term-for-sharedworkerglobalscope" style="color:initial">SharedWorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-window" style="color:initial">Window</span>
     <li><span class="dfn-paneled" id="term-for-windoworworkerglobalscope" style="color:initial">WindowOrWorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-worker" style="color:initial">Worker</span>
     <li><span class="dfn-paneled" id="term-for-workerglobalscope" style="color:initial">WorkerGlobalScope</span>
     <li><span class="dfn-paneled" id="term-for-workerlocation" style="color:initial">WorkerLocation</span>
     <li><span class="dfn-paneled" id="term-for-workernavigator" style="color:initial">WorkerNavigator</span>
     <li><span class="dfn-paneled" id="term-for-workertype" style="color:initial">WorkerType</span>
     <li><span class="dfn-paneled" id="term-for-about:blank" style="color:initial">about:blank</span>
     <li><span class="dfn-paneled" id="term-for-active-document" style="color:initial">active document</span>
     <li><span class="dfn-paneled" id="term-for-api-base-url" style="color:initial">api base url</span>
     <li><span class="dfn-paneled" id="term-for-api-url-character-encoding" style="color:initial">api url character encoding</span>
     <li><span class="dfn-paneled" id="term-for-application-cache" style="color:initial">application cache</span>
     <li><span class="dfn-paneled" id="term-for-auxiliary-browsing-context" style="color:initial">auxiliary browsing context</span>
     <li><span class="dfn-paneled" id="term-for-browsing-context" style="color:initial">browsing context</span>
     <li><span class="dfn-paneled" id="term-for-classic-script" style="color:initial">classic script</span>
     <li><span class="dfn-paneled" id="term-for-creation-url" style="color:initial">creation url</span>
     <li><span class="dfn-paneled" id="term-for-discard-a-document" style="color:initial">discard a document</span>
     <li><span class="dfn-paneled" id="term-for-dom-manipulation-task-source" style="color:initial">dom manipulation task source</span>
     <li><span class="dfn-paneled" id="term-for-environment-settings-object" style="color:initial">environment settings object</span>
     <li><span class="dfn-paneled" id="term-for-event-handlers" style="color:initial">event handler</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-event-type" style="color:initial">event handler event type</span>
     <li><span class="dfn-paneled" id="term-for-event-handler-idl-attributes" style="color:initial">event handler idl attribute</span>
     <li><span class="dfn-paneled" id="term-for-event-loop" style="color:initial">event loop</span>
     <li><span class="dfn-paneled" id="term-for-exceptions-enabled" style="color:initial">exceptions enabled flag</span>
     <li><span class="dfn-paneled" id="term-for-fetch-a-classic-worker-script" style="color:initial">fetch a classic worker script</span>
     <li><span class="dfn-paneled" id="term-for-fetch-a-module-worker-script-tree" style="color:initial">fetch a module worker script tree</span>
     <li><span class="dfn-paneled" id="term-for-fire-a-simple-event" style="color:initial">fire a simple event</span>
     <li><span class="dfn-paneled" id="term-for-focusing-steps" style="color:initial">focusing steps</span>
     <li><span class="dfn-paneled" id="term-for-concept-settings-object-global" style="color:initial">global object</span>
     <li><span class="dfn-paneled" id="term-for-has-focus-steps" style="color:initial">has focus steps</span>
     <li><span class="dfn-paneled" id="term-for-concept-workerglobalscope-https-state" style="color:initial">https state <small>(for workerglobalscope)</small></span>
     <li><span class="dfn-paneled" id="term-for-import-scripts-into-worker-global-scope" style="color:initial">import scripts into worker global scope</span>
     <li><span class="dfn-paneled" id="term-for-dom-workerglobalscope-importscripts" style="color:initial">importScripts(urls)</span>
     <li><span class="dfn-paneled" id="term-for-in-parallel" style="color:initial">in parallel</span>
     <li><span class="dfn-paneled" id="term-for-incumbent-settings-object" style="color:initial">incumbent settings object</span>
     <li><span class="dfn-paneled" id="term-for-fetching-scripts-is-top-level" style="color:initial">is top-level</span>
     <li><span class="dfn-paneled" id="term-for-list-of-active-timers" style="color:initial">list of active timers</span>
     <li><span class="dfn-paneled" id="term-for-event-message" style="color:initial">message</span>
     <li><span class="dfn-paneled" id="term-for-module-script" style="color:initial">module script</span>
     <li><span class="dfn-paneled" id="term-for-navigate" style="color:initial">navigate</span>
     <li><span class="dfn-paneled" id="term-for-nested-browsing-context" style="color:initial">nested browsing context</span>
     <li><span class="dfn-paneled" id="term-for-origin-2" style="color:initial">origin</span>
     <li><span class="dfn-paneled" id="term-for-parent-browsing-context" style="color:initial">parent browsing context</span>
     <li><span class="dfn-paneled" id="term-for-fetching-scripts-perform-fetch" style="color:initial">perform the fetch</span>
     <li><span class="dfn-paneled" id="term-for-queue-a-task" style="color:initial">queue a task</span>
     <li><span class="dfn-paneled" id="term-for-realm-execution-context" style="color:initial">realm execution context</span>
     <li><span class="dfn-paneled" id="term-for-concept-relevant-global" style="color:initial">relevant global object</span>
     <li><span class="dfn-paneled" id="term-for-concept-relevant-realm" style="color:initial">relevant realm</span>
     <li><span class="dfn-paneled" id="term-for-relevant-settings-object" style="color:initial">relevant settings object</span>
     <li><span class="dfn-paneled" id="term-for-replacement-enabled" style="color:initial">replacement enabled</span>
     <li><span class="dfn-paneled" id="term-for-responsible-browsing-context" style="color:initial">responsible browsing context</span>
     <li><span class="dfn-paneled" id="term-for-responsible-document" style="color:initial">responsible document</span>
     <li><span class="dfn-paneled" id="term-for-responsible-event-loop" style="color:initial">responsible event loop</span>
     <li><span class="dfn-paneled" id="term-for-run-a-classic-script" style="color:initial">run a classic script</span>
     <li><span class="dfn-paneled" id="term-for-run-a-module-script" style="color:initial">run a module script</span>
     <li><span class="dfn-paneled" id="term-for-same-origin" style="color:initial">same origin</span>
     <li><span class="dfn-paneled" id="term-for-concept-script" style="color:initial">script</span>
     <li><span class="dfn-paneled" id="term-for-shared-workers" style="color:initial">shared workers</span>
     <li><span class="dfn-paneled" id="term-for-source-browsing-context" style="color:initial">source browsing context</span>
     <li><span class="dfn-paneled" id="term-for-structuredclonewithtransfer" style="color:initial">structuredclonewithtransfer</span>
     <li><span class="dfn-paneled" id="term-for-concept-task" style="color:initial">task</span>
     <li><span class="dfn-paneled" id="term-for-task-queue" style="color:initial">task queue</span>
     <li><span class="dfn-paneled" id="term-for-task-source" style="color:initial">task source</span>
     <li><span class="dfn-paneled" id="term-for-terminate-a-worker" style="color:initial">terminate a worker</span>
     <li><span class="dfn-paneled" id="term-for-concept-global-object-realm" style="color:initial">the global object's realm</span>
     <li><span class="dfn-paneled" id="term-for-concept-realm-global" style="color:initial">the realm's global object</span>
     <li><span class="dfn-paneled" id="term-for-top-level-browsing-context" style="color:initial">top-level browsing context</span>
     <li><span class="dfn-paneled" id="term-for-triggered-by-user-activation" style="color:initial">triggered by user activation</span>
     <li><span class="dfn-paneled" id="term-for-concept-workerglobalscope-type" style="color:initial">type</span>
     <li><span class="dfn-paneled" id="term-for-unload-a-document" style="color:initial">unload a document</span>
     <li><span class="dfn-paneled" id="term-for-unsafe-response" style="color:initial">unsafe response</span>
     <li><span class="dfn-paneled" id="term-for-concept-workerglobalscope-url" style="color:initial">url</span>
     <li><span class="dfn-paneled" id="term-for-user-interaction-task-source" style="color:initial">user interaction task source</span>
     <li><span class="dfn-paneled" id="term-for-workers" style="color:initial">web worker</span>
    </ul>
   <li>
    <a data-link-type="biblio">[page-visibility]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-VisibilityState" style="color:initial">VisibilityState</span>
     <li><span class="dfn-paneled" id="term-for-dom-document-visibilitystate" style="color:initial">visibilityState</span>
    </ul>
   <li>
    <a data-link-type="biblio">[promises-guide]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-transforming-by" style="color:initial">transforming</span>
     <li><span class="dfn-paneled" id="term-for-waiting-for-all" style="color:initial">waiting for all</span>
    </ul>
   <li>
    <a data-link-type="biblio">[quota-api]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-widl-ServiceWorkerGlobalScope-onbeforeevicted" style="color:initial">onbeforeevicted</span>
     <li><span class="dfn-paneled" id="term-for-widl-ServiceWorkerGlobalScope-onevicted" style="color:initial">onevicted</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc7230]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-3.2" style="color:initial">field-value</span>
    </ul>
   <li>
    <a data-link-type="biblio">[rfc7231]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-section-7.1.4" style="color:initial">vary</span>
    </ul>
   <li>
    <a data-link-type="biblio">[secure-contexts]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-is-origin-trustworthy" style="color:initial">is origin potentially trustworthy</span>
     <li><span class="dfn-paneled" id="term-for-threat-risks" style="color:initial">risks associated with insecure contexts</span>
     <li><span class="dfn-paneled" id="term-for-secure-context" style="color:initial">secure context</span>
    </ul>
   <li>
    <a data-link-type="biblio">[URL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-url-equals" style="color:initial">equal</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-parser" style="color:initial">parsing</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-path" style="color:initial">path</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-query" style="color:initial">query</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-scheme" style="color:initial">scheme</span>
     <li><span class="dfn-paneled" id="term-for-concept-url-serializer" style="color:initial">serialized</span>
    </ul>
   <li>
    <a data-link-type="biblio">[WebIDL]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-idl-DOMString" style="color:initial">DOMString</span>
     <li><span class="dfn-paneled" id="term-for-Exposed" style="color:initial">Exposed</span>
     <li><span class="dfn-paneled" id="term-for-Global" style="color:initial">Global</span>
     <li><span class="dfn-paneled" id="term-for-invalidaccesserror" style="color:initial">InvalidAccessError</span>
     <li><span class="dfn-paneled" id="term-for-invalidstateerror" style="color:initial">InvalidStateError</span>
     <li><span class="dfn-paneled" id="term-for-NewObject" style="color:initial">NewObject</span>
     <li><span class="dfn-paneled" id="term-for-quotaexceedederror" style="color:initial">QuotaExceededError</span>
     <li><span class="dfn-paneled" id="term-for-SameObject" style="color:initial">SameObject</span>
     <li><span class="dfn-paneled" id="term-for-SecureContext" style="color:initial">SecureContext</span>
     <li><span class="dfn-paneled" id="term-for-securityerror" style="color:initial">SecurityError</span>
     <li><span class="dfn-paneled" id="term-for-idl-USVString" style="color:initial">USVString</span>
     <li><span class="dfn-paneled" id="term-for-idl-boolean" style="color:initial">boolean</span>
     <li><span class="dfn-paneled" id="term-for-dfn-exception" style="color:initial">exception</span>
     <li><span class="dfn-paneled" id="term-for-dfn-frozen-array-type" style="color:initial">frozen array type</span>
     <li><span class="dfn-paneled" id="term-for-idl-object" style="color:initial">object</span>
     <li><span class="dfn-paneled" id="term-for-dfn-partial-interface" style="color:initial">partial interface</span>
     <li><span class="dfn-paneled" id="term-for-dfn-present" style="color:initial">present</span>
     <li><span class="dfn-paneled" id="term-for-dfn-throw" style="color:initial">throw</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-csp2">[CSP2]
   <dd>Mike West; Adam Barth; Daniel Veditz. <a href="https://www.w3.org/TR/CSP2/">Content Security Policy Level 2</a>. 15 December 2016. REC. URL: <a href="https://www.w3.org/TR/CSP2/">https://www.w3.org/TR/CSP2/</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-ecmascript">[ECMASCRIPT]
   <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a>
   <dt id="biblio-fetch">[FETCH]
   <dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
   <dt id="biblio-html">[HTML]
   <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/">HTML Standard</a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a>
   <dt id="biblio-page-visibility">[PAGE-VISIBILITY]
   <dd>Jatinder Mann; Arvind Jain. <a href="https://www.w3.org/TR/page-visibility/">Page Visibility (Second Edition)</a>. 29 October 2013. REC. URL: <a href="https://www.w3.org/TR/page-visibility/">https://www.w3.org/TR/page-visibility/</a>
   <dt id="biblio-promises-guide">[PROMISES-GUIDE]
   <dd><a href="https://www.w3.org/2001/tag/doc/promises-guide">Writing Promise-Using Specifications</a>. 24 July 2015. Finding of the W3C TAG. URL: <a href="https://www.w3.org/2001/tag/doc/promises-guide">https://www.w3.org/2001/tag/doc/promises-guide</a>
   <dt id="biblio-quota-api">[QUOTA-API]
   <dd>Kinuko Yasuda. <a href="https://www.w3.org/TR/quota-api/">Quota Management API</a>. 23 May 2016. NOTE. URL: <a href="https://www.w3.org/TR/quota-api/">https://www.w3.org/TR/quota-api/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
   <dt id="biblio-rfc5234">[RFC5234]
   <dd>D. Crocker, Ed.; P. Overell. <a href="https://tools.ietf.org/html/rfc5234">Augmented BNF for Syntax Specifications: ABNF</a>. January 2008. Internet Standard. URL: <a href="https://tools.ietf.org/html/rfc5234">https://tools.ietf.org/html/rfc5234</a>
   <dt id="biblio-rfc7230">[RFC7230]
   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href="https://httpwg.org/specs/rfc7230.html">Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a>. June 2014. Proposed Standard. URL: <a href="https://httpwg.org/specs/rfc7230.html">https://httpwg.org/specs/rfc7230.html</a>
   <dt id="biblio-rfc7231">[RFC7231]
   <dd>R. Fielding, Ed.; J. Reschke, Ed.. <a href="https://httpwg.org/specs/rfc7231.html">Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</a>. June 2014. Proposed Standard. URL: <a href="https://httpwg.org/specs/rfc7231.html">https://httpwg.org/specs/rfc7231.html</a>
   <dt id="biblio-secure-contexts">[SECURE-CONTEXTS]
   <dd>Mike West. <a href="https://www.w3.org/TR/secure-contexts/">Secure Contexts</a>. 15 September 2016. CR. URL: <a href="https://www.w3.org/TR/secure-contexts/">https://www.w3.org/TR/secure-contexts/</a>
   <dt id="biblio-url">[URL]
   <dd>Anne van Kesteren. <a href="https://url.spec.whatwg.org/">URL Standard</a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a>
   <dt id="biblio-webidl">[WebIDL]
   <dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-notifications">[NOTIFICATIONS]
   <dd>Anne van Kesteren. <a href="https://notifications.spec.whatwg.org/">Notifications API Standard</a>. Living Standard. URL: <a href="https://notifications.spec.whatwg.org/">https://notifications.spec.whatwg.org/</a>
   <dt id="biblio-unsanctioned-tracking">[UNSANCTIONED-TRACKING]
   <dd><a href="https://www.w3.org/2001/tag/doc/unsanctioned-tracking/">Unsanctioned Web Tracking</a>. 17 July 2015. Finding of the W3C TAG. URL: <a href="https://www.w3.org/2001/tag/doc/unsanctioned-tracking/">https://www.w3.org/2001/tag/doc/unsanctioned-tracking/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
<pre class="idl highlight def">[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑧"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①③"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-interface" id="ref-for-service-worker-interface①①⓪"><c- g>ServiceWorker</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget③"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑧"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#service-worker-url-attribute" id="ref-for-service-worker-url-attribute②"><c- g>scriptURL</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum④"><c- n>ServiceWorkerState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerState" href="#service-worker-state-attribute" id="ref-for-service-worker-state-attribute④"><c- g>state</c-></a>;
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#service-worker-postmessage-method" id="ref-for-service-worker-postmessage-method②"><c- g>postMessage</c-></a>(<c- b>any</c-> <a href="#dom-serviceworker-postmessage-message-transfer-message"><code><c- g>message</c-></code></a>, <c- b>optional</c-> <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object②"><c- b>object</c-></a>> <a href="#dom-serviceworker-postmessage-message-transfer-transfer"><code><c- g>transfer</c-></code></a>);

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑧"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-onstatechange-attribute" id="ref-for-service-worker-onstatechange-attribute①"><c- g>onstatechange</c-></a>;
};
<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②⑨"><c- n>ServiceWorker</c-></a> <c- b>implements</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#abstractworker" id="ref-for-abstractworker①"><c- n>AbstractWorker</c-></a>;

<c- b>enum</c-> <a class="idl-code" data-link-type="enum" href="#service-worker-state-enum" id="ref-for-service-worker-state-enum①①"><c- g>ServiceWorkerState</c-></a> {
  <a href="#dom-serviceworkerstate-installing"><code><c- s>"installing"</c-></code></a>,
  <a href="#dom-serviceworkerstate-installed"><code><c- s>"installed"</c-></code></a>,
  <a href="#dom-serviceworkerstate-activating"><code><c- s>"activating"</c-></code></a>,
  <a href="#dom-serviceworkerstate-activated"><code><c- s>"activated"</c-></code></a>,
  <a href="#dom-serviceworkerstate-redundant"><code><c- s>"redundant"</c-></code></a>
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext①①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①④"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①⑨"><c- g>ServiceWorkerRegistration</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget①①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface⑧①"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-installing-attribute" id="ref-for-service-worker-registration-installing-attribute②"><c- g>installing</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface⑨①"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-waiting-attribute" id="ref-for-service-worker-registration-waiting-attribute②"><c- g>waiting</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⓪①"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-registration-active-attribute" id="ref-for-service-worker-registration-active-attribute②"><c- g>active</c-></a>;

  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString①①"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#service-worker-registration-scope-attribute" id="ref-for-service-worker-registration-scope-attribute②"><c- g>scope</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②⑤"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#service-worker-registration-update-method" id="ref-for-service-worker-registration-update-method②"><c- g>update</c-></a>();
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①①⓪"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①②"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#service-worker-registration-unregister-method" id="ref-for-service-worker-registration-unregister-method④"><c- g>unregister</c-></a>();

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler①①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-registration-onupdatefound-attribute" id="ref-for-service-worker-registration-onupdatefound-attribute①"><c- g>onupdatefound</c-></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/system-state.html#navigator" id="ref-for-navigator③"><c- g>Navigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext②①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑨"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①⑤"><c- n>ServiceWorkerContainer</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerContainer" href="#navigator-service-worker-attribute" id="ref-for-navigator-service-worker-attribute①①"><c- g>serviceWorker</c-></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/workers.html#workernavigator" id="ref-for-workernavigator③"><c- g>WorkerNavigator</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext③①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject①①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface①④"><c- n>ServiceWorkerContainer</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerContainer" href="#navigator-service-worker-attribute" id="ref-for-navigator-service-worker-attribute②①"><c- g>serviceWorker</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext④①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed②①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-container-interface" id="ref-for-service-worker-container-interface④①"><c- g>ServiceWorkerContainer</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#eventtarget" id="ref-for-eventtarget②①"><c- n>EventTarget</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①④①"><c- n>ServiceWorker</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorker?" href="#service-worker-container-controller-attribute" id="ref-for-service-worker-container-controller-attribute④"><c- g>controller</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject②①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface④①"><c- n>ServiceWorkerRegistration</c-></a>> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Promise<ServiceWorkerRegistration>" href="#service-worker-container-ready-attribute" id="ref-for-service-worker-container-ready-attribute②"><c- g>ready</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②④"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑤①"><c- n>ServiceWorkerRegistration</c-></a>> <a class="idl-code" data-link-type="method" href="#service-worker-container-register-method" id="ref-for-service-worker-container-register-method③"><c- g>register</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString②①"><c- b>USVString</c-></a> <a href="#dom-serviceworkercontainer-register-scripturl-options-scripturl"><code><c- g>scriptURL</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-serviceworkercontainer-registrationoptions" id="ref-for-dictdef-serviceworkercontainer-registrationoptions①"><c- n>RegistrationOptions</c-></a> <a href="#dom-serviceworkercontainer-register-scripturl-options-options"><code><c- g>options</c-></code></a>);

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject③①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#service-worker-container-getregistration-method" id="ref-for-service-worker-container-getregistration-method②"><c- g>getRegistration</c-></a>(<c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString③①"><c- b>USVString</c-></a> <a href="#dom-serviceworkercontainer-getregistration-clienturl-clienturl"><code><c- g>clientURL</c-></code></a> = "");
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject④①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface⑥①"><c- n>ServiceWorkerRegistration</c-></a>>> <a class="idl-code" data-link-type="method" href="#service-worker-container-getregistrations-method" id="ref-for-service-worker-container-getregistrations-method②"><c- g>getRegistrations</c-></a>();

  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#service-worker-container-startMessages-method" id="ref-for-service-worker-container-startMessages-method②"><c- g>startMessages</c-></a>();


  // events
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler②①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-container-oncontrollerchange-attribute" id="ref-for-service-worker-container-oncontrollerchange-attribute①"><c- g>oncontrollerchange</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler③①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-container-onmessage-attribute" id="ref-for-service-worker-container-onmessage-attribute①"><c- g>onmessage</c-></a>; // event.source of message events is ServiceWorker object
};

<c- b>dictionary</c-> <a href="#dictdef-serviceworkercontainer-registrationoptions"><code><c- g>RegistrationOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString④①"><c- b>USVString</c-></a> <a data-type="USVString " href="#dom-registrationoptions-scope"><code><c- g>scope</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#workertype" id="ref-for-workertype①"><c- n>WorkerType</c-></a> <a data-default="&quot;classic&quot;" data-type="WorkerType " href="#dom-registrationoptions-type"><code><c- g>type</c-></code></a> = "classic";
};

[<a href="#dom-serviceworkermessageevent-serviceworkermessageevent"><code><c- g>Constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②②"><c- b>DOMString</c-></a> <a href="#dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-serviceworkermessageevent-serviceworkermessageeventinit" id="ref-for-dictdef-serviceworkermessageevent-serviceworkermessageeventinit①"><c- n>ServiceWorkerMessageEventInit</c-></a> <a href="#dom-serviceworkermessageevent-serviceworkermessageevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed③①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#serviceworkermessage-event-interface" id="ref-for-serviceworkermessage-event-interface①①"><c- g>ServiceWorkerMessageEvent</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event⑤"><c- n>Event</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#serviceworkermessage-event-data-attribute" id="ref-for-serviceworkermessage-event-data-attribute③"><c- g>data</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①⓪"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#serviceworkermessage-event-origin-attribute" id="ref-for-serviceworkermessage-event-origin-attribute③"><c- g>origin</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②③"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#serviceworkermessage-event-lasteventid-attribute" id="ref-for-serviceworkermessage-event-lasteventid-attribute②"><c- g>lastEventId</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject③①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> (<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⑦①"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport①②"><c- n>MessagePort</c-></a>)? <a class="idl-code" data-link-type="attribute" data-readonly data-type="(ServiceWorker or MessagePort)?" href="#serviceworkermessage-event-source-attribute" id="ref-for-serviceworkermessage-event-source-attribute③"><c- g>source</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport②①"><c- n>MessagePort</c-></a>>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<MessagePort>?" href="#serviceworkermessage-event-ports-attribute" id="ref-for-serviceworkermessage-event-ports-attribute③"><c- g>ports</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-serviceworkermessageevent-serviceworkermessageeventinit"><code><c- g>ServiceWorkerMessageEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit②"><c- n>EventInit</c-></a> {
  <c- b>any</c-> <a data-type="any " href="#dom-serviceworkermessageeventinit-data"><code><c- g>data</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString③①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-serviceworkermessageeventinit-origin"><code><c- g>origin</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString④①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-serviceworkermessageeventinit-lasteventid"><code><c- g>lastEventId</c-></code></a>;
  (<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface①⑧①"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport③①"><c- n>MessagePort</c-></a>)? <a data-type="(ServiceWorker or MessagePort)? " href="#dom-serviceworkermessageeventinit-source"><code><c- g>source</c-></code></a>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport④①"><c- n>MessagePort</c-></a>>? <a data-type="sequence<MessagePort>? " href="#dom-serviceworkermessageeventinit-ports"><code><c- g>ports</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Global" id="ref-for-Global①"><c- g>Global</c-></a>=(<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#worker" id="ref-for-worker①"><c- n>Worker</c-></a>,<a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②②①"><c- n>ServiceWorker</c-></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed④①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#service-worker-global-scope-interface" id="ref-for-service-worker-global-scope-interface④①"><c- g>ServiceWorkerGlobalScope</c-></a> : <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope" id="ref-for-workerglobalscope③"><c- n>WorkerGlobalScope</c-></a> {
  // A container for a list of Client objects that correspond to
  // browsing contexts (or shared workers) that are on the origin of this SW
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject④①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#clients-interface" id="ref-for-clients-interface④"><c- n>Clients</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Clients" href="#service-worker-global-scope-clients-attribute" id="ref-for-service-worker-global-scope-clients-attribute②"><c- g>clients</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑤①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#service-worker-registration-interface" id="ref-for-service-worker-registration-interface①①①"><c- n>ServiceWorkerRegistration</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="ServiceWorkerRegistration" href="#service-worker-global-scope-scope-attribute" id="ref-for-service-worker-global-scope-scope-attribute②"><c- g>registration</c-></a>;

  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑤①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#service-worker-global-scope-skipwaiting-method" id="ref-for-service-worker-global-scope-skipwaiting-method③"><c- g>skipWaiting</c-></a>();

  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler④①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-oninstall-attribute" id="ref-for-service-worker-global-scope-oninstall-attribute①"><c- g>oninstall</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑤①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onactivate-attribute" id="ref-for-service-worker-global-scope-onactivate-attribute①"><c- g>onactivate</c-></a>;
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑥①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onfetch-attribute" id="ref-for-service-worker-global-scope-onfetch-attribute①"><c- g>onfetch</c-></a>;

  // event
  <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/webappapis.html#eventhandler" id="ref-for-eventhandler⑦①"><c- n>EventHandler</c-></a> <a class="idl-code" data-link-type="attribute" data-type="EventHandler" href="#service-worker-global-scope-onmessage-attribute" id="ref-for-service-worker-global-scope-onmessage-attribute①"><c- g>onmessage</c-></a>; // event.source of the message events is Client object
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑤①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#client-interface" id="ref-for-client-interface②①"><c- g>Client</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑤①"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#client-url-attribute" id="ref-for-client-url-attribute②"><c- g>url</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#contextframetype-enum" id="ref-for-contextframetype-enum②"><c- n>FrameType</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrameType" href="#client-frametype-attribute" id="ref-for-client-frametype-attribute②"><c- g>frameType</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑤①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#client-id-attribute" id="ref-for-client-id-attribute②"><c- g>id</c-></a>;
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#client-postmessage-method" id="ref-for-client-postmessage-method②"><c- g>postMessage</c-></a>(<c- b>any</c-> <a href="#dom-client-postmessage-message-transfer-message"><code><c- g>message</c-></code></a>, <c- b>optional</c-> <c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-object" id="ref-for-idl-object①①"><c- b>object</c-></a>> <a href="#dom-client-postmessage-message-transfer-transfer"><code><c- g>transfer</c-></code></a>);
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑥①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#window-client-interface" id="ref-for-window-client-interface①①"><c- g>WindowClient</c-></a> : <a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface③①"><c- n>Client</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://www.w3.org/TR/page-visibility/#VisibilityState" id="ref-for-VisibilityState①"><c- n>VisibilityState</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="VisibilityState" href="#client-visibilitystate-attribute" id="ref-for-client-visibilitystate-attribute②"><c- g>visibilityState</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#client-focused-attribute" id="ref-for-client-focused-attribute②"><c- g>focused</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑥①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface②①"><c- n>WindowClient</c-></a>> <a class="idl-code" data-link-type="method" href="#client-focus-method" id="ref-for-client-focus-method②"><c- g>focus</c-></a>();
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑦①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface③①"><c- n>WindowClient</c-></a>> <a href="#dom-windowclient-navigate"><code><c- g>navigate</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑥①"><c- b>USVString</c-></a> <a href="#dom-windowclient-navigate-url-url"><code><c- g>url</c-></code></a>);
};

<c- b>enum</c-> <a class="idl-code" data-link-type="enum" href="#contextframetype-enum" id="ref-for-contextframetype-enum①①"><c- g>FrameType</c-></a> {
  <a href="#dom-frametype-auxiliary"><code><c- s>"auxiliary"</c-></code></a>,
  <a href="#dom-frametype-top-level"><code><c- s>"top-level"</c-></code></a>,
  <a href="#dom-frametype-nested"><code><c- s>"nested"</c-></code></a>,
  <a href="#dom-frametype-none"><code><c- s>"none"</c-></code></a>
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑦①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#clients-interface" id="ref-for-clients-interface③①"><c- g>Clients</c-></a> {
  // The objects returned will be new instances every time
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑧①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#clients-get-method" id="ref-for-clients-get-method②"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑥①"><c- b>DOMString</c-></a> <a href="#dom-clients-get-id-id"><code><c- g>id</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject⑨①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface④①"><c- n>Client</c-></a>>> <a class="idl-code" data-link-type="method" href="#clients-matchall-method" id="ref-for-clients-matchall-method②"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-clients-clientqueryoptions" id="ref-for-dictdef-clients-clientqueryoptions①"><c- n>ClientQueryOptions</c-></a> <a href="#dom-clients-matchall-options-options"><code><c- g>options</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⓪①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#window-client-interface" id="ref-for-window-client-interface⑤①"><c- n>WindowClient</c-></a>?> <a class="idl-code" data-link-type="method" href="#clients-openwindow-method" id="ref-for-clients-openwindow-method②"><c- g>openWindow</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-USVString" id="ref-for-idl-USVString⑦①"><c- b>USVString</c-></a> <a href="#dom-clients-openwindow-url-url"><code><c- g>url</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①①①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#clients-claim-method" id="ref-for-clients-claim-method②"><c- g>claim</c-></a>();
};

<c- b>dictionary</c-> <a href="#dictdef-clients-clientqueryoptions"><code><c- g>ClientQueryOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean②①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-clientqueryoptions-includeuncontrolled"><code><c- g>includeUncontrolled</c-></code></a> = <c- b>false</c->;
  <a class="n" data-link-type="idl-name" href="#enumdef-clients-clienttype" id="ref-for-enumdef-clients-clienttype①"><c- n>ClientType</c-></a> <a data-default="&quot;window&quot;" data-type="ClientType " href="#dom-clientqueryoptions-type"><code><c- g>type</c-></code></a> = "window";
};

<c- b>enum</c-> <a href="#enumdef-clients-clienttype"><code><c- g>ClientType</c-></code></a> {
  <a href="#dom-clienttype-window"><code><c- s>"window"</c-></code></a>,
  <a href="#dom-clienttype-worker"><code><c- s>"worker"</c-></code></a>,
  <a href="#dom-clienttype-sharedworker"><code><c- s>"sharedworker"</c-></code></a>,
  <a href="#dom-clienttype-all"><code><c- s>"all"</c-></code></a>
};

[<a href="#dom-extendableevent-extendableevent"><code><c- g>Constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑦①"><c- b>DOMString</c-></a> <a href="#dom-extendableevent-extendableevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit③"><c- n>ExtendableEventInit</c-></a> <a href="#dom-extendableevent-extendableevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑧①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#extendable-event-interface" id="ref-for-extendable-event-interface①⑤"><c- g>ExtendableEvent</c-></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#event" id="ref-for-event④①"><c- n>Event</c-></a> {
  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#extendable-event-waituntil-method" id="ref-for-extendable-event-waituntil-method④"><c- g>waitUntil</c-></a>(<c- b>Promise</c->&lt;<c- b>any</c->> <a href="#dom-extendableevent-waituntil-f-f"><code><c- g>f</c-></code></a>);
};

<c- b>dictionary</c-> <a href="#dictdef-extendableeventinit"><code><c- g>ExtendableEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="https://dom.spec.whatwg.org/#dictdef-eventinit" id="ref-for-dictdef-eventinit①①"><c- n>EventInit</c-></a> {
  // Defined for the forward compatibility across the derived events
};

[<a href="#dom-fetchevent-fetchevent"><code><c- g>Constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑧①"><c- b>DOMString</c-></a> <a href="#dom-fetchevent-fetchevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <a class="n" data-link-type="idl-name" href="#dictdef-fetchevent-fetcheventinit" id="ref-for-dictdef-fetchevent-fetcheventinit①"><c- n>FetchEventInit</c-></a> <a href="#dom-fetchevent-fetchevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed⑨①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#fetch-event-interface" id="ref-for-fetch-event-interface①①"><c- g>FetchEvent</c-></a> : <a class="n" data-link-type="idl-name" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑥①"><c- n>ExtendableEvent</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑥①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request②④"><c- n>Request</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="Request" href="#fetch-event-request-attribute" id="ref-for-fetch-event-request-attribute②"><c- g>request</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString⑨①"><c- b>DOMString</c-></a>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString?" href="#fetch-event-clientid-attribute" id="ref-for-fetch-event-clientid-attribute②"><c- g>clientId</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean③①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="boolean" href="#fetch-event-isreload-attribute" id="ref-for-fetch-event-isreload-attribute②"><c- g>isReload</c-></a>;

  <c- b>void</c-> <a class="idl-code" data-link-type="method" href="#fetch-event-respondwith-method" id="ref-for-fetch-event-respondwith-method④"><c- g>respondWith</c-></a>(<c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response①⑨"><c- n>Response</c-></a>> <a href="#dom-fetchevent-respondwith-r-r"><code><c- g>r</c-></code></a>);
};

<c- b>dictionary</c-> <a href="#dictdef-fetchevent-fetcheventinit"><code><c- g>FetchEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit①①"><c- n>ExtendableEventInit</c-></a> {
  <c- b>required</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request①①⓪"><c- n>Request</c-></a> <a data-type="Request " href="#dom-fetcheventinit-request"><code><c- g>request</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⓪①"><c- b>DOMString</c-></a>? <a data-default="null" data-type="DOMString? " href="#dom-fetcheventinit-clientid"><code><c- g>clientId</c-></code></a> = <c- b>null</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean④①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-fetcheventinit-isreload"><code><c- g>isReload</c-></code></a> = <c- b>false</c->;
};

[<a href="#dom-extendablemessageevent-extendablemessageevent"><code><c- g>Constructor</c-></code></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①①①"><c- b>DOMString</c-></a> <a href="#dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-type"><code><c- g>type</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-extendablemessageevent-extendablemessageeventinit" id="ref-for-dictdef-extendablemessageevent-extendablemessageeventinit①"><c- n>ExtendableMessageEventInit</c-></a> <a href="#dom-extendablemessageevent-extendablemessageevent-type-eventinitdict-eventinitdict"><code><c- g>eventInitDict</c-></code></a>), <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①⓪①"><c- g>Exposed</c-></a>=<c- n>ServiceWorker</c->]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#extendablemessage-event-interface" id="ref-for-extendablemessage-event-interface②①"><c- g>ExtendableMessageEvent</c-></a> : <a class="n" data-link-type="idl-name" href="#extendable-event-interface" id="ref-for-extendable-event-interface⑧①"><c- n>ExtendableEvent</c-></a> {
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>any</c-> <a class="idl-code" data-link-type="attribute" data-readonly data-type="any" href="#extendablemessage-event-data-attribute" id="ref-for-extendablemessage-event-data-attribute①①"><c- g>data</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①②①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#extendablemessage-event-origin-attribute" id="ref-for-extendablemessage-event-origin-attribute①①"><c- g>origin</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①③①"><c- b>DOMString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="DOMString" href="#extendablemessage-event-lasteventid-attribute" id="ref-for-extendablemessage-event-lasteventid-attribute②"><c- g>lastEventId</c-></a>;
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑦①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> (<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface⑤①"><c- n>Client</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②④①"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑦①"><c- n>MessagePort</c-></a>)? <a class="idl-code" data-link-type="attribute" data-readonly data-type="(Client or ServiceWorker or MessagePort)?" href="#extendablemessage-event-source-attribute" id="ref-for-extendablemessage-event-source-attribute②①"><c- g>source</c-></a>;
  <c- b>readonly</c-> <c- b>attribute</c-> <c- b>FrozenArray</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑧①"><c- n>MessagePort</c-></a>>? <a class="idl-code" data-link-type="attribute" data-readonly data-type="FrozenArray<MessagePort>?" href="#extendablemessage-event-ports-attribute" id="ref-for-extendablemessage-event-ports-attribute①①"><c- g>ports</c-></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-extendablemessageevent-extendablemessageeventinit"><code><c- g>ExtendableMessageEventInit</c-></code></a> : <a class="n" data-link-type="idl-name" href="#dictdef-extendableeventinit" id="ref-for-dictdef-extendableeventinit②①"><c- n>ExtendableEventInit</c-></a> {
  <c- b>any</c-> <a data-type="any " href="#dom-extendablemessageeventinit-data"><code><c- g>data</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①④①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-extendablemessageeventinit-origin"><code><c- g>origin</c-></code></a>;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑤①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-extendablemessageeventinit-lasteventid"><code><c- g>lastEventId</c-></code></a>;
  (<a class="n" data-link-type="idl-name" href="#client-interface" id="ref-for-client-interface⑥①"><c- n>Client</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="#service-worker-interface" id="ref-for-service-worker-interface②⑤①"><c- n>ServiceWorker</c-></a> <c- b>or</c-> <a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport⑨①"><c- n>MessagePort</c-></a>)? <a data-type="(Client or ServiceWorker or MessagePort)? " href="#dom-extendablemessageeventinit-source"><code><c- g>source</c-></code></a>;
  <c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/web-messaging.html#messageport" id="ref-for-messageport①⓪①"><c- n>MessagePort</c-></a>>? <a data-type="sequence<MessagePort>? " href="#dom-extendablemessageeventinit-ports"><code><c- g>ports</c-></code></a>;
};

<c- b>partial</c-> <c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope" id="ref-for-windoworworkerglobalscope①"><c- g>WindowOrWorkerGlobalScope</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑤①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SameObject" id="ref-for-SameObject⑧①"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a class="n" data-link-type="idl-name" href="#cache-storage-interface" id="ref-for-cache-storage-interface⑦"><c- n>CacheStorage</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="CacheStorage" href="#global-caches-attribute" id="ref-for-global-caches-attribute①①"><c- g>caches</c-></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑥①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①①①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#cache-interface" id="ref-for-cache-interface①①①"><c- g>Cache</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①②①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#cache-match-method" id="ref-for-cache-match-method⑥"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑧"><c- n>RequestInfo</c-></a> <a href="#dom-cache-match-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions⑦"><c- n>CacheQueryOptions</c-></a> <a href="#dom-cache-match-request-options-options"><code><c- g>options</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①③①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑦①"><c- n>Response</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-matchall-method" id="ref-for-cache-matchall-method③"><c- g>matchAll</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo①①"><c- n>RequestInfo</c-></a> <a href="#dom-cache-matchall-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions①①"><c- n>CacheQueryOptions</c-></a> <a href="#dom-cache-matchall-request-options-options"><code><c- g>options</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①④①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-add-method" id="ref-for-cache-add-method②"><c- g>add</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo②①"><c- n>RequestInfo</c-></a> <a href="#dom-cache-add-request-request"><code><c- g>request</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑤①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-addAll-method" id="ref-for-cache-addAll-method③"><c- g>addAll</c-></a>(<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo③①"><c- n>RequestInfo</c-></a>> <a href="#dom-cache-addall-requests-requests"><code><c- g>requests</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑥①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>void</c->> <a class="idl-code" data-link-type="method" href="#cache-put-method" id="ref-for-cache-put-method②"><c- g>put</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo④①"><c- n>RequestInfo</c-></a> <a href="#dom-cache-put-request-response-request"><code><c- g>request</c-></code></a>, <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑧①"><c- n>Response</c-></a> <a href="#dom-cache-put-request-response-response"><code><c- g>response</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑦①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑤①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-delete-method" id="ref-for-cache-delete-method②"><c- g>delete</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑤①"><c- n>RequestInfo</c-></a> <a href="#dom-cache-delete-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions②①"><c- n>CacheQueryOptions</c-></a> <a href="#dom-cache-delete-request-options-options"><code><c- g>options</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑧①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request③①"><c- n>Request</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-keys-method" id="ref-for-cache-keys-method②"><c- g>keys</c-></a>(<c- b>optional</c-> <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑥①"><c- n>RequestInfo</c-></a> <a href="#dom-cache-keys-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions③①"><c- n>CacheQueryOptions</c-></a> <a href="#dom-cache-keys-request-options-options"><code><c- g>options</c-></code></a>);
};

<c- b>dictionary</c-> <a href="#dictdef-cache-cachequeryoptions"><code><c- g>CacheQueryOptions</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑥①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-cachequeryoptions-ignoresearch"><code><c- g>ignoreSearch</c-></code></a> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑦①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-cachequeryoptions-ignoremethod"><code><c- g>ignoreMethod</c-></code></a> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑧①"><c- b>boolean</c-></a> <a data-default="false" data-type="boolean " href="#dom-cachequeryoptions-ignorevary"><code><c- g>ignoreVary</c-></code></a> = <c- b>false</c->;
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑥①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-cachequeryoptions-cachename"><code><c- g>cacheName</c-></code></a>;
};

<c- b>dictionary</c-> <a href="#dictdef-cache-cachebatchoperation"><code><c- g>CacheBatchOperation</c-></code></a> {
  <a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑦①"><c- b>DOMString</c-></a> <a data-type="DOMString " href="#dom-cachebatchoperation-type"><code><c- g>type</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#request" id="ref-for-request④①"><c- n>Request</c-></a> <a data-type="Request " href="#dom-cachebatchoperation-request"><code><c- g>request</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#response" id="ref-for-response⑨①"><c- n>Response</c-></a> <a data-type="Response " href="#dom-cachebatchoperation-response"><code><c- g>response</c-></code></a>;
  <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions④①"><c- n>CacheQueryOptions</c-></a> <a data-type="CacheQueryOptions " href="#dom-cachebatchoperation-options"><code><c- g>options</c-></code></a>;
};

[<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#SecureContext" id="ref-for-SecureContext⑦①"><c- g>SecureContext</c-></a>, <a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#Exposed" id="ref-for-Exposed①②①"><c- g>Exposed</c-></a>=(<c- n>Window</c->,<c- n>Worker</c->)]
<c- b>interface</c-> <a class="idl-code" data-link-type="interface" href="#cache-storage-interface" id="ref-for-cache-storage-interface③①"><c- g>CacheStorage</c-></a> {
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject①⑨①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>any</c->> <a class="idl-code" data-link-type="method" href="#cache-storage-match-method" id="ref-for-cache-storage-match-method②"><c- g>match</c-></a>(<a class="n" data-link-type="idl-name" href="https://fetch.spec.whatwg.org/#requestinfo" id="ref-for-requestinfo⑦①"><c- n>RequestInfo</c-></a> <a href="#dom-cachestorage-match-request-options-request"><code><c- g>request</c-></code></a>, <c- b>optional</c-> <a class="n" data-link-type="idl-name" href="#dictdef-cache-cachequeryoptions" id="ref-for-dictdef-cache-cachequeryoptions⑤①"><c- n>CacheQueryOptions</c-></a> <a href="#dom-cachestorage-match-request-options-options"><code><c- g>options</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②⓪①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean⑨①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-has-method" id="ref-for-cache-storage-has-method③"><c- g>has</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑧①"><c- b>DOMString</c-></a> <a href="#dom-cachestorage-has-cachename-cachename"><code><c- g>cacheName</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②①①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="n" data-link-type="idl-name" href="#cache-interface" id="ref-for-cache-interface①④①"><c- n>Cache</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-open-method" id="ref-for-cache-storage-open-method②"><c- g>open</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString①⑨①"><c- b>DOMString</c-></a> <a href="#dom-cachestorage-open-cachename-cachename"><code><c- g>cacheName</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②②①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-boolean" id="ref-for-idl-boolean①⓪①"><c- b>boolean</c-></a>> <a class="idl-code" data-link-type="method" href="#cache-storage-delete-method" id="ref-for-cache-storage-delete-method②"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②⓪①"><c- b>DOMString</c-></a> <a href="#dom-cachestorage-delete-cachename-cachename"><code><c- g>cacheName</c-></code></a>);
  [<a class="idl-code" data-link-type="extended-attribute" href="https://heycam.github.io/webidl/#NewObject" id="ref-for-NewObject②③①"><c- g>NewObject</c-></a>] <c- b>Promise</c->&lt;<c- b>sequence</c->&lt;<a class="idl-code" data-link-type="interface" href="https://heycam.github.io/webidl/#idl-DOMString" id="ref-for-idl-DOMString②①①"><c- b>DOMString</c-></a>>> <a class="idl-code" data-link-type="method" href="#cache-storage-keys-method" id="ref-for-cache-storage-keys-method②"><c- g>keys</c-></a>();
};

</pre>
  <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2>
  <div style="counter-reset:issue">
   <div class="issue">The response’s cache state concept had been removed from fetch. The fetch issue <a href="https://github.com/whatwg/fetch/issues/376">#376</a> tracks the request to restore the concept or add some similar way to check this state.<a href="#issue-b27ba9d2"> ↵ </a></div>
   <div class="issue">Remove this definition after sorting out the referencing sites.<a href="#issue-b739bfcf"> ↵ </a></div>
  </div>
  <aside class="dfn-panel" data-for="dfn-service-worker">
   <b><a href="#dfn-service-worker">#dfn-service-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker">1. Motivations</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker">(5)</a> <a href="#ref-for-dfn-service-worker">(6)</a> <a href="#ref-for-dfn-service-worker">(7)</a> <a href="#ref-for-dfn-service-worker">(8)</a> <a href="#ref-for-dfn-service-worker">(9)</a> <a href="#ref-for-dfn-service-worker">(10)</a> <a href="#ref-for-dfn-service-worker">(11)</a> <a href="#ref-for-dfn-service-worker">(12)</a> <a href="#ref-for-dfn-service-worker">(13)</a> <a href="#ref-for-dfn-service-worker">(14)</a>
    <li><a href="#ref-for-dfn-service-worker">2.1. Service Worker</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker">(5)</a> <a href="#ref-for-dfn-service-worker">(6)</a> <a href="#ref-for-dfn-service-worker">(7)</a> <a href="#ref-for-dfn-service-worker">(8)</a> <a href="#ref-for-dfn-service-worker">(9)</a> <a href="#ref-for-dfn-service-worker">(10)</a> <a href="#ref-for-dfn-service-worker">(11)</a> <a href="#ref-for-dfn-service-worker">(12)</a>
    <li><a href="#ref-for-dfn-service-worker">2.1.1. Lifetime</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a>
    <li><a href="#ref-for-dfn-service-worker">2.5. Task Sources</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a>
    <li><a href="#ref-for-dfn-service-worker">2.6. User Agent Shutdown</a>
    <li><a href="#ref-for-dfn-service-worker">3.1. ServiceWorker</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a>
    <li><a href="#ref-for-dfn-service-worker">3.1.1. scriptURL</a>
    <li><a href="#ref-for-dfn-service-worker">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-service-worker">3.2.1. installing</a>
    <li><a href="#ref-for-dfn-service-worker">3.2.2. waiting</a>
    <li><a href="#ref-for-dfn-service-worker">3.2.3. active</a>
    <li><a href="#ref-for-dfn-service-worker">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-dfn-service-worker">3.4.1. controller</a>
    <li><a href="#ref-for-dfn-service-worker">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">3.5.2. event.origin</a>
    <li><a href="#ref-for-dfn-service-worker">3.5.4. event.source</a>
    <li><a href="#ref-for-dfn-service-worker">3.6. Events</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">4.1. ServiceWorkerGlobalScope</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a>
    <li><a href="#ref-for-dfn-service-worker">4.1.3. skipWaiting()</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a>
    <li><a href="#ref-for-dfn-service-worker">4.4. ExtendableEvent</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker">(5)</a> <a href="#ref-for-dfn-service-worker">(6)</a> <a href="#ref-for-dfn-service-worker">(7)</a>
    <li><a href="#ref-for-dfn-service-worker">4.5. FetchEvent</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">4.6. ExtendableMessageEvent</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">5.2. Understanding Cache Lifetimes</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">6.1. Secure Context</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker">(5)</a>
    <li><a href="#ref-for-dfn-service-worker">6.2. Content Security Policy</a>
    <li><a href="#ref-for-dfn-service-worker">6.3.1. Origin restriction</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a>
    <li><a href="#ref-for-dfn-service-worker">6.4. Cross-Origin Resources and CORS</a>
    <li><a href="#ref-for-dfn-service-worker">6.5. Implementer Concerns</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a>
    <li><a href="#ref-for-dfn-service-worker">6.6. Privacy</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">7. Storage Considerations</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">8. Extensibility</a>
    <li><a href="#ref-for-dfn-service-worker">8.4. Request Functional Event Dispatch</a>
    <li><a href="#ref-for-dfn-service-worker">Update</a>
    <li><a href="#ref-for-dfn-service-worker">Install</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">Run Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker">Terminate Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker">Handle Fetch</a>
    <li><a href="#ref-for-dfn-service-worker">Update Registration State</a>
    <li><a href="#ref-for-dfn-service-worker">Update Worker State</a> <a href="#ref-for-dfn-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker">(5)</a> <a href="#ref-for-dfn-service-worker">(6)</a> <a href="#ref-for-dfn-service-worker">(7)</a> <a href="#ref-for-dfn-service-worker">(8)</a> <a href="#ref-for-dfn-service-worker">(9)</a> <a href="#ref-for-dfn-service-worker">(10)</a>
    <li><a href="#ref-for-dfn-service-worker">Get Newest Worker</a>
    <li><a href="#ref-for-dfn-service-worker">Service Worker Script Request</a> <a href="#ref-for-dfn-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker">Service Worker Script Response</a>
    <li><a href="#ref-for-dfn-service-worker">Syntax</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-state">
   <b><a href="#dfn-state">#dfn-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-state">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-state">(2)</a> <a href="#ref-for-dfn-state">(3)</a>
    <li><a href="#ref-for-dfn-state">3.1. ServiceWorker</a>
    <li><a href="#ref-for-dfn-state">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-state">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-dfn-state">4.4. ExtendableEvent</a> <a href="#ref-for-dfn-state">(2)</a> <a href="#ref-for-dfn-state">(3)</a>
    <li><a href="#ref-for-dfn-state">Handle Fetch</a> <a href="#ref-for-dfn-state">(2)</a>
    <li><a href="#ref-for-dfn-state">Handle Functional Event</a> <a href="#ref-for-dfn-state">(2)</a>
    <li><a href="#ref-for-dfn-state">Update Worker State</a> <a href="#ref-for-dfn-state">(2)</a> <a href="#ref-for-dfn-state">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-script-url">
   <b><a href="#dfn-script-url">#dfn-script-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-script-url">3.1.1. scriptURL</a>
    <li><a href="#ref-for-dfn-script-url">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-script-url">Register</a>
    <li><a href="#ref-for-dfn-script-url">Update</a> <a href="#ref-for-dfn-script-url">(2)</a> <a href="#ref-for-dfn-script-url">(3)</a>
    <li><a href="#ref-for-dfn-script-url">Soft Update</a>
    <li><a href="#ref-for-dfn-script-url">Run Service Worker</a> <a href="#ref-for-dfn-script-url">(2)</a> <a href="#ref-for-dfn-script-url">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-type">
   <b><a href="#dfn-type">#dfn-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-type">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-type">Update</a>
    <li><a href="#ref-for-dfn-type①">Soft Update</a>
    <li><a href="#ref-for-dfn-type">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-containing-service-worker-registration">
   <b><a href="#dfn-containing-service-worker-registration">#dfn-containing-service-worker-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">2.1. Service Worker</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">2.4. Selection and Use</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">3.2.6. unregister()</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">4.1.2. registration</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">4.1.3. skipWaiting()</a> <a href="#ref-for-dfn-containing-service-worker-registration">(2)</a> <a href="#ref-for-dfn-containing-service-worker-registration">(3)</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">4.3.4. claim()</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">4.7. Events</a> <a href="#ref-for-dfn-containing-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">Install</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">Run Service Worker</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">Terminate Service Worker</a>
    <li><a href="#ref-for-dfn-containing-service-worker-registration">Handle Fetch</a> <a href="#ref-for-dfn-containing-service-worker-registration">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-id">
   <b><a href="#dfn-service-worker-id">#dfn-service-worker-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-id">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-lifecycle-events">
   <b><a href="#dfn-lifecycle-events">#dfn-lifecycle-events</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-lifecycle-events">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-dfn-lifecycle-events">4.7. Events</a> <a href="#ref-for-dfn-lifecycle-events">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-functional-events">
   <b><a href="#dfn-functional-events">#dfn-functional-events</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-functional-events">2.5. Task Sources</a>
    <li><a href="#ref-for-dfn-functional-events">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-dfn-functional-events">4.5. FetchEvent</a>
    <li><a href="#ref-for-dfn-functional-events">4.7. Events</a>
    <li><a href="#ref-for-dfn-functional-events">8.2. Define Functional Event</a>
    <li><a href="#ref-for-dfn-functional-events">8.3. Define Event Handler</a>
    <li><a href="#ref-for-dfn-functional-events">8.4. Request Functional Event Dispatch</a> <a href="#ref-for-dfn-functional-events">(2)</a> <a href="#ref-for-dfn-functional-events">(3)</a>
    <li><a href="#ref-for-dfn-functional-events">Update Worker State</a> <a href="#ref-for-dfn-functional-events">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-script-resource">
   <b><a href="#dfn-script-resource">#dfn-script-resource</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-script-resource">2.1. Service Worker</a> <a href="#ref-for-dfn-script-resource">(2)</a>
    <li><a href="#ref-for-dfn-script-resource">6.2. Content Security Policy</a> <a href="#ref-for-dfn-script-resource">(2)</a>
    <li><a href="#ref-for-dfn-script-resource">Update</a> <a href="#ref-for-dfn-script-resource">(2)</a>
    <li><a href="#ref-for-dfn-script-resource">Run Service Worker</a> <a href="#ref-for-dfn-script-resource①">(2)</a>
    <li><a href="#ref-for-dfn-script-resource">Service Worker Script Request</a> <a href="#ref-for-dfn-script-resource">(2)</a>
    <li><a href="#ref-for-dfn-script-resource">Service Worker Script Response</a>
    <li><a href="#ref-for-dfn-script-resource">Syntax</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-has-ever-been-evaluated-flag">
   <b><a href="#dfn-has-ever-been-evaluated-flag">#dfn-has-ever-been-evaluated-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-has-ever-been-evaluated-flag">Run Service Worker</a> <a href="#ref-for-dfn-has-ever-been-evaluated-flag">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-https-state">
   <b><a href="#dfn-https-state">#dfn-https-state</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-https-state">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-script-resource-map">
   <b><a href="#dfn-script-resource-map">#dfn-script-resource-map</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-script-resource-map">6.3.2. importScripts(urls)</a> <a href="#ref-for-dfn-script-resource-map">(2)</a> <a href="#ref-for-dfn-script-resource-map">(3)</a>
    <li><a href="#ref-for-dfn-script-resource-map">6.6. Privacy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-skip-waiting-flag">
   <b><a href="#dfn-skip-waiting-flag">#dfn-skip-waiting-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-skip-waiting-flag">3.6. Events</a>
    <li><a href="#ref-for-dfn-skip-waiting-flag">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-dfn-skip-waiting-flag">Install</a> <a href="#ref-for-dfn-skip-waiting-flag">(2)</a> <a href="#ref-for-dfn-skip-waiting-flag">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-imported-scripts-updated-flag">
   <b><a href="#dfn-imported-scripts-updated-flag">#dfn-imported-scripts-updated-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-imported-scripts-updated-flag">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-dfn-imported-scripts-updated-flag">Install</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-set-of-event-types-to-handle">
   <b><a href="#dfn-set-of-event-types-to-handle">#dfn-set-of-event-types-to-handle</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-set-of-event-types-to-handle">Run Service Worker</a>
    <li><a href="#ref-for-dfn-set-of-event-types-to-handle">Handle Fetch</a>
    <li><a href="#ref-for-dfn-set-of-event-types-to-handle">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-registration">
   <b><a href="#dfn-service-worker-registration">#dfn-service-worker-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration">2.1. Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker-registration">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a> <a href="#ref-for-dfn-service-worker-registration">(4)</a> <a href="#ref-for-dfn-service-worker-registration">(5)</a> <a href="#ref-for-dfn-service-worker-registration">(6)</a> <a href="#ref-for-dfn-service-worker-registration">(7)</a> <a href="#ref-for-dfn-service-worker-registration">(8)</a> <a href="#ref-for-dfn-service-worker-registration">(9)</a> <a href="#ref-for-dfn-service-worker-registration">(10)</a> <a href="#ref-for-dfn-service-worker-registration">(11)</a> <a href="#ref-for-dfn-service-worker-registration">(12)</a> <a href="#ref-for-dfn-service-worker-registration">(13)</a> <a href="#ref-for-dfn-service-worker-registration">(14)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">2.2.1. Lifetime</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a> <a href="#ref-for-dfn-service-worker-registration">(4)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">2.4. Selection and Use</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a> <a href="#ref-for-dfn-service-worker-registration">(4)</a> <a href="#ref-for-dfn-service-worker-registration">(5)</a> <a href="#ref-for-dfn-service-worker-registration">(6)</a> <a href="#ref-for-dfn-service-worker-registration">(7)</a> <a href="#ref-for-dfn-service-worker-registration">(8)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">2.6. User Agent Shutdown</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.2. ServiceWorkerRegistration</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.2.6. unregister()</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.4. ServiceWorkerContainer</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.4.2. ready</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">3.6. Events</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">6.1. Secure Context</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">6.6. Privacy</a>
    <li><a href="#ref-for-dfn-service-worker-registration">8.1. Define API bound to Service Worker Registration</a>
    <li><a href="#ref-for-dfn-service-worker-registration">8.4. Request Functional Event Dispatch</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Appendix A: Algorithms</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a> <a href="#ref-for-dfn-service-worker-registration">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Soft Update</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Install</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Activate</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Handle Functional Event</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Handle Service Worker Client Unload</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Set Registration</a> <a href="#ref-for-dfn-service-worker-registration">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Clear Registration</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Update Registration State</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Match Service Worker Registration</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Get Registration</a>
    <li><a href="#ref-for-dfn-service-worker-registration">Get Newest Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-scope-url">
   <b><a href="#dfn-scope-url">#dfn-scope-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-scope-url">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-scope-url">(2)</a> <a href="#ref-for-dfn-scope-url">(3)</a>
    <li><a href="#ref-for-dfn-scope-url">2.2.1. Lifetime</a>
    <li><a href="#ref-for-dfn-scope-url">2.4. Selection and Use</a>
    <li><a href="#ref-for-dfn-scope-url">3.2.4. scope</a>
    <li><a href="#ref-for-dfn-scope-url">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-scope-url">3.2.6. unregister()</a>
    <li><a href="#ref-for-dfn-scope-url">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-dfn-scope-url">(2)</a>
    <li><a href="#ref-for-dfn-scope-url">Appendix A: Algorithms</a> <a href="#ref-for-dfn-scope-url">(2)</a>
    <li><a href="#ref-for-dfn-scope-url">Update</a>
    <li><a href="#ref-for-dfn-scope-url">Soft Update</a>
    <li><a href="#ref-for-dfn-scope-url">Install</a>
    <li><a href="#ref-for-dfn-scope-url">Activate</a>
    <li><a href="#ref-for-dfn-scope-url">Set Registration</a>
    <li><a href="#ref-for-dfn-scope-url">Clear Registration</a>
    <li><a href="#ref-for-dfn-scope-url">Service Worker Script Response</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-installing-worker">
   <b><a href="#dfn-installing-worker">#dfn-installing-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-installing-worker">2.2. Service Worker Registration</a>
    <li><a href="#ref-for-dfn-installing-worker">2.6. User Agent Shutdown</a> <a href="#ref-for-dfn-installing-worker①">(2)</a>
    <li><a href="#ref-for-dfn-installing-worker">3.6. Events</a>
    <li><a href="#ref-for-dfn-installing-worker">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-dfn-installing-worker">4.7. Events</a>
    <li><a href="#ref-for-dfn-installing-worker">Install</a> <a href="#ref-for-dfn-installing-worker">(2)</a> <a href="#ref-for-dfn-installing-worker">(3)</a> <a href="#ref-for-dfn-installing-worker">(4)</a> <a href="#ref-for-dfn-installing-worker">(5)</a>
    <li><a href="#ref-for-dfn-installing-worker②">Handle User Agent Shutdown</a> <a href="#ref-for-dfn-installing-worker③">(2)</a>
    <li><a href="#ref-for-dfn-installing-worker">Clear Registration</a> <a href="#ref-for-dfn-installing-worker">(2)</a>
    <li><a href="#ref-for-dfn-installing-worker④">Update Registration State</a> <a href="#ref-for-dfn-installing-worker⑤">(2)</a> <a href="#ref-for-dfn-installing-worker⑥">(3)</a>
    <li><a href="#ref-for-dfn-installing-worker">Update Worker State</a> <a href="#ref-for-dfn-installing-worker">(2)</a>
    <li><a href="#ref-for-dfn-installing-worker">Get Newest Worker</a> <a href="#ref-for-dfn-installing-worker">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-waiting-worker">
   <b><a href="#dfn-waiting-worker">#dfn-waiting-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-waiting-worker">2.2. Service Worker Registration</a>
    <li><a href="#ref-for-dfn-waiting-worker">2.6. User Agent Shutdown</a>
    <li><a href="#ref-for-dfn-waiting-worker">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-dfn-waiting-worker">4.4. ExtendableEvent</a> <a href="#ref-for-dfn-waiting-worker">(2)</a>
    <li><a href="#ref-for-dfn-waiting-worker">Install</a> <a href="#ref-for-dfn-waiting-worker">(2)</a> <a href="#ref-for-dfn-waiting-worker">(3)</a> <a href="#ref-for-dfn-waiting-worker">(4)</a> <a href="#ref-for-dfn-waiting-worker">(5)</a> <a href="#ref-for-dfn-waiting-worker">(6)</a>
    <li><a href="#ref-for-dfn-waiting-worker">Activate</a> <a href="#ref-for-dfn-waiting-worker">(2)</a>
    <li><a href="#ref-for-dfn-waiting-worker">Handle Service Worker Client Unload</a>
    <li><a href="#ref-for-dfn-waiting-worker①">Handle User Agent Shutdown</a>
    <li><a href="#ref-for-dfn-waiting-worker">Clear Registration</a> <a href="#ref-for-dfn-waiting-worker">(2)</a>
    <li><a href="#ref-for-dfn-waiting-worker②">Update Registration State</a> <a href="#ref-for-dfn-waiting-worker③">(2)</a> <a href="#ref-for-dfn-waiting-worker④">(3)</a>
    <li><a href="#ref-for-dfn-waiting-worker">Update Worker State</a>
    <li><a href="#ref-for-dfn-waiting-worker">Get Newest Worker</a> <a href="#ref-for-dfn-waiting-worker">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-active-worker">
   <b><a href="#dfn-active-worker">#dfn-active-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-active-worker">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a> <a href="#ref-for-dfn-active-worker">(4)</a> <a href="#ref-for-dfn-active-worker">(5)</a> <a href="#ref-for-dfn-active-worker">(6)</a>
    <li><a href="#ref-for-dfn-active-worker">2.3. Service Worker Client</a>
    <li><a href="#ref-for-dfn-active-worker">2.4. Selection and Use</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">2.6. User Agent Shutdown</a>
    <li><a href="#ref-for-dfn-active-worker">3.4.2. ready</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">3.6. Events</a>
    <li><a href="#ref-for-dfn-active-worker">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-dfn-active-worker">4.3.4. claim()</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-dfn-active-worker">4.7. Events</a>
    <li><a href="#ref-for-dfn-active-worker">Activate</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a> <a href="#ref-for-dfn-active-worker">(4)</a> <a href="#ref-for-dfn-active-worker">(5)</a> <a href="#ref-for-dfn-active-worker">(6)</a> <a href="#ref-for-dfn-active-worker">(7)</a>
    <li><a href="#ref-for-dfn-active-worker">Run Service Worker</a>
    <li><a href="#ref-for-dfn-active-worker">Handle Fetch</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">Handle Functional Event</a> <a href="#ref-for-dfn-active-worker">(2)</a>
    <li><a href="#ref-for-dfn-active-worker">Clear Registration</a> <a href="#ref-for-dfn-active-worker">(2)</a>
    <li><a href="#ref-for-dfn-active-worker">Update Registration State</a> <a href="#ref-for-dfn-active-worker①">(2)</a> <a href="#ref-for-dfn-active-worker②">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">Update Worker State</a> <a href="#ref-for-dfn-active-worker">(2)</a> <a href="#ref-for-dfn-active-worker">(3)</a>
    <li><a href="#ref-for-dfn-active-worker">Get Newest Worker</a> <a href="#ref-for-dfn-active-worker">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-last-update-check-time">
   <b><a href="#dfn-last-update-check-time">#dfn-last-update-check-time</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-last-update-check-time">Update</a> <a href="#ref-for-dfn-last-update-check-time">(2)</a> <a href="#ref-for-dfn-last-update-check-time">(3)</a>
    <li><a href="#ref-for-dfn-last-update-check-time">Handle Fetch</a> <a href="#ref-for-dfn-last-update-check-time">(2)</a> <a href="#ref-for-dfn-last-update-check-time">(3)</a>
    <li><a href="#ref-for-dfn-last-update-check-time">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-uninstalling-flag">
   <b><a href="#dfn-uninstalling-flag">#dfn-uninstalling-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-uninstalling-flag">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-dfn-uninstalling-flag">Register</a>
    <li><a href="#ref-for-dfn-uninstalling-flag">Update</a>
    <li><a href="#ref-for-dfn-uninstalling-flag">Handle Service Worker Client Unload</a>
    <li><a href="#ref-for-dfn-uninstalling-flag">Unregister</a>
    <li><a href="#ref-for-dfn-uninstalling-flag">Match Service Worker Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-registration-task-queue">
   <b><a href="#dfn-service-worker-registration-task-queue">#dfn-service-worker-registration-task-queue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration-task-queue">2.2. Service Worker Registration</a> <a href="#ref-for-dfn-service-worker-registration-task-queue">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-registration-task-queue">Run Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker-registration-task-queue">Terminate Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client">
   <b><a href="#dfn-service-worker-client">#dfn-service-worker-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client">2.1. Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker-client">2.1.1. Lifetime</a>
    <li><a href="#ref-for-dfn-service-worker-client">2.2.1. Lifetime</a>
    <li><a href="#ref-for-dfn-service-worker-client">2.3. Service Worker Client</a> <a href="#ref-for-dfn-service-worker-client">(2)</a> <a href="#ref-for-dfn-service-worker-client">(3)</a> <a href="#ref-for-dfn-service-worker-client">(4)</a> <a href="#ref-for-dfn-service-worker-client">(5)</a> <a href="#ref-for-dfn-service-worker-client">(6)</a>
    <li><a href="#ref-for-dfn-service-worker-client">2.4. Selection and Use</a> <a href="#ref-for-dfn-service-worker-client">(2)</a> <a href="#ref-for-dfn-service-worker-client">(3)</a> <a href="#ref-for-dfn-service-worker-client">(4)</a> <a href="#ref-for-dfn-service-worker-client">(5)</a> <a href="#ref-for-dfn-service-worker-client">(6)</a> <a href="#ref-for-dfn-service-worker-client">(7)</a> <a href="#ref-for-dfn-service-worker-client">(8)</a> <a href="#ref-for-dfn-service-worker-client">(9)</a>
    <li><a href="#ref-for-dfn-service-worker-client">3.2.6. unregister()</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-dfn-service-worker-client">3.6. Events</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.2. Client</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.3.1. get(id)</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.3.2. matchAll(options)</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.3.4. claim()</a>
    <li><a href="#ref-for-dfn-service-worker-client">4.6.2. event.origin</a>
    <li><a href="#ref-for-dfn-service-worker-client">6.1. Secure Context</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">6.3.1. Origin restriction</a>
    <li><a href="#ref-for-dfn-service-worker-client">Appendix A: Algorithms</a>
    <li><a href="#ref-for-dfn-service-worker-client">Create Job</a>
    <li><a href="#ref-for-dfn-service-worker-client">Install</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">Activate</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">Run Service Worker</a>
    <li><a href="#ref-for-dfn-service-worker-client">Handle Fetch</a> <a href="#ref-for-dfn-service-worker-client">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-client">Handle Service Worker Client Unload</a> <a href="#ref-for-dfn-service-worker-client">(2)</a> <a href="#ref-for-dfn-service-worker-client">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-client">Unregister</a>
    <li><a href="#ref-for-dfn-service-worker-client">Notify Controller Change</a>
    <li><a href="#ref-for-dfn-service-worker-client">Create Client</a>
    <li><a href="#ref-for-dfn-service-worker-client">Create Window Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-active-worker">
   <b><a href="#dfn-service-worker-client-active-worker">#dfn-service-worker-client-active-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">3.2.6. unregister()</a>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">3.4.1. controller</a>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">3.6. Events</a>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">4.2.8. navigate(url)</a>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-dfn-service-worker-client-active-worker">Handle Fetch</a> <a href="#ref-for-dfn-service-worker-client-active-worker">(2)</a> <a href="#ref-for-dfn-service-worker-client-active-worker">(3)</a> <a href="#ref-for-dfn-service-worker-client-active-worker">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-id">
   <b><a href="#dfn-service-worker-client-id">#dfn-service-worker-client-id</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-id">4.2.3. id</a>
    <li><a href="#ref-for-dfn-service-worker-client-id">4.3.1. get(id)</a>
    <li><a href="#ref-for-dfn-service-worker-client-id">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-frame-type">
   <b><a href="#dfn-service-worker-client-frame-type">#dfn-service-worker-client-frame-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-frame-type">4.2.2. frameType</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-window-client">
   <b><a href="#dfn-window-client">#dfn-window-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-window-client">4.2.2. frameType</a> <a href="#ref-for-dfn-window-client">(2)</a> <a href="#ref-for-dfn-window-client">(3)</a>
    <li><a href="#ref-for-dfn-window-client">4.3.1. get(id)</a>
    <li><a href="#ref-for-dfn-window-client">4.3.2. matchAll(options)</a> <a href="#ref-for-dfn-window-client">(2)</a> <a href="#ref-for-dfn-window-client">(3)</a>
    <li><a href="#ref-for-dfn-window-client">Activate</a>
    <li><a href="#ref-for-dfn-window-client">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-dedicatedworker-client">
   <b><a href="#dfn-dedicatedworker-client">#dfn-dedicatedworker-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-dedicatedworker-client">2.3. Service Worker Client</a>
    <li><a href="#ref-for-dfn-dedicatedworker-client">4.3.2. matchAll(options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-sharedworker-client">
   <b><a href="#dfn-sharedworker-client">#dfn-sharedworker-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-sharedworker-client">2.3. Service Worker Client</a>
    <li><a href="#ref-for-dfn-sharedworker-client">4.3.2. matchAll(options)</a>
    <li><a href="#ref-for-dfn-sharedworker-client">Activate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-worker-client">
   <b><a href="#dfn-worker-client">#dfn-worker-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-worker-client">2.4. Selection and Use</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-registration-selection">
   <b><a href="#dfn-service-worker-registration-selection">#dfn-service-worker-registration-selection</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration-selection">2.4. Selection and Use</a> <a href="#ref-for-dfn-service-worker-registration-selection">(2)</a> <a href="#ref-for-dfn-service-worker-registration-selection">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-control">
   <b><a href="#dfn-control">#dfn-control</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-control">2.3. Service Worker Client</a>
    <li><a href="#ref-for-dfn-control">2.4. Selection and Use</a>
    <li><a href="#ref-for-dfn-control">3.2.6. unregister()</a>
    <li><a href="#ref-for-dfn-control">3.6. Events</a>
    <li><a href="#ref-for-dfn-control">Service Worker Script Response</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-use">
   <b><a href="#dfn-use">#dfn-use</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-use">2.4. Selection and Use</a>
    <li><a href="#ref-for-dfn-use">3.6. Events</a>
    <li><a href="#ref-for-dfn-use">4.1.3. skipWaiting()</a>
    <li><a href="#ref-for-dfn-use">Install</a>
    <li><a href="#ref-for-dfn-use">Activate</a>
    <li><a href="#ref-for-dfn-use">Handle Fetch</a>
    <li><a href="#ref-for-dfn-use">Handle Service Worker Client Unload</a> <a href="#ref-for-dfn-use">(2)</a>
    <li><a href="#ref-for-dfn-use">Unregister</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-handle-fetch-task-source">
   <b><a href="#dfn-handle-fetch-task-source">#dfn-handle-fetch-task-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-handle-fetch-task-source">2.2. Service Worker Registration</a>
    <li><a href="#ref-for-dfn-handle-fetch-task-source">Terminate Service Worker</a> <a href="#ref-for-dfn-handle-fetch-task-source">(2)</a>
    <li><a href="#ref-for-dfn-handle-fetch-task-source">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-handle-functional-event-task-source">
   <b><a href="#dfn-handle-functional-event-task-source">#dfn-handle-functional-event-task-source</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-handle-functional-event-task-source">2.2. Service Worker Registration</a>
    <li><a href="#ref-for-dfn-handle-functional-event-task-source">Terminate Service Worker</a> <a href="#ref-for-dfn-handle-functional-event-task-source">(2)</a>
    <li><a href="#ref-for-dfn-handle-functional-event-task-source">Handle Functional Event</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-interface">
   <b><a href="#service-worker-interface">#service-worker-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-interface">2.1.1. Lifetime</a>
    <li><a href="#ref-for-service-worker-interface">3.1. ServiceWorker</a> <a href="#ref-for-service-worker-interface①">(2)</a> <a href="#ref-for-service-worker-interface②">(3)</a> <a href="#ref-for-service-worker-interface③">(4)</a> <a href="#ref-for-service-worker-interface④">(5)</a> <a href="#ref-for-service-worker-interface⑤">(6)</a>
    <li><a href="#ref-for-service-worker-interface⑥">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-service-worker-interface⑦">3.1.4. Event handler</a>
    <li><a href="#ref-for-service-worker-interface⑧">3.2. ServiceWorkerRegistration</a> <a href="#ref-for-service-worker-interface⑨">(2)</a> <a href="#ref-for-service-worker-interface①⓪">(3)</a>
    <li><a href="#ref-for-service-worker-interface①①">3.2.1. installing</a>
    <li><a href="#ref-for-service-worker-interface①②">3.2.2. waiting</a>
    <li><a href="#ref-for-service-worker-interface①③">3.2.3. active</a>
    <li><a href="#ref-for-service-worker-interface①④">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-interface①⑤">3.4.1. controller</a> <a href="#ref-for-service-worker-interface①⑥">(2)</a>
    <li><a href="#ref-for-service-worker-interface①⑦">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-service-worker-interface①⑧">(2)</a> <a href="#ref-for-service-worker-interface①⑨">(3)</a>
    <li><a href="#ref-for-service-worker-interface">3.5.4. event.source</a>
    <li><a href="#ref-for-service-worker-interface②⓪">3.6. Events</a> <a href="#ref-for-service-worker-interface②①">(2)</a>
    <li><a href="#ref-for-service-worker-interface②②">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-interface②③">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-service-worker-interface②④">4.6. ExtendableMessageEvent</a> <a href="#ref-for-service-worker-interface②⑤">(2)</a>
    <li><a href="#ref-for-service-worker-interface②⑥">Update Registration State</a> <a href="#ref-for-service-worker-interface②⑦">(2)</a> <a href="#ref-for-service-worker-interface②⑧">(3)</a>
    <li><a href="#ref-for-service-worker-interface">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-url-attribute">
   <b><a href="#service-worker-url-attribute">#service-worker-url-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-url-attribute">3.1. ServiceWorker</a>
    <li><a href="#ref-for-service-worker-url-attribute①">3.1.1. scriptURL</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-state-attribute">
   <b><a href="#service-worker-state-attribute">#service-worker-state-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-state-attribute">3.1. ServiceWorker</a>
    <li><a href="#ref-for-service-worker-state-attribute①">3.1.2. state</a>
    <li><a href="#ref-for-service-worker-state-attribute②">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-service-worker-state-attribute③">3.6. Events</a>
    <li><a href="#ref-for-service-worker-state-attribute">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-state-enum">
   <b><a href="#service-worker-state-enum">#service-worker-state-enum</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-state-enum">3.1. ServiceWorker</a> <a href="#ref-for-service-worker-state-enum①">(2)</a> <a href="#ref-for-service-worker-state-enum②">(3)</a>
    <li><a href="#ref-for-service-worker-state-enum③">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-postmessage-method">
   <b><a href="#service-worker-postmessage-method">#service-worker-postmessage-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-postmessage-method">3.1. ServiceWorker</a>
    <li><a href="#ref-for-service-worker-postmessage-method①">3.1.3. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-onstatechange-attribute">
   <b><a href="#service-worker-onstatechange-attribute">#service-worker-onstatechange-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-onstatechange-attribute">3.1. ServiceWorker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-interface">
   <b><a href="#service-worker-registration-interface">#service-worker-registration-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-interface">2.2.1. Lifetime</a>
    <li><a href="#ref-for-service-worker-registration-interface">3.2. ServiceWorkerRegistration</a> <a href="#ref-for-service-worker-registration-interface①">(2)</a> <a href="#ref-for-service-worker-registration-interface②">(3)</a> <a href="#ref-for-service-worker-registration-interface③">(4)</a>
    <li><a href="#ref-for-service-worker-registration-interface">3.2.7. Event handler</a>
    <li><a href="#ref-for-service-worker-registration-interface④">3.4. ServiceWorkerContainer</a> <a href="#ref-for-service-worker-registration-interface⑤">(2)</a> <a href="#ref-for-service-worker-registration-interface⑥">(3)</a>
    <li><a href="#ref-for-service-worker-registration-interface⑦">3.4.2. ready</a>
    <li><a href="#ref-for-service-worker-registration-interface⑧">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-service-worker-registration-interface⑨">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-service-worker-registration-interface①⓪">3.6. Events</a>
    <li><a href="#ref-for-service-worker-registration-interface①①">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-registration-interface①②">4.1.2. registration</a>
    <li><a href="#ref-for-service-worker-registration-interface①③">8.1. Define API bound to Service Worker Registration</a>
    <li><a href="#ref-for-service-worker-registration-interface①④">Register</a>
    <li><a href="#ref-for-service-worker-registration-interface①⑤">Update</a>
    <li><a href="#ref-for-service-worker-registration-interface①⑥">Install</a> <a href="#ref-for-service-worker-registration-interface①⑦">(2)</a>
    <li><a href="#ref-for-service-worker-registration-interface①⑧">Update Registration State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-registration-interface-service-worker-registration">
   <b><a href="#dfn-service-worker-registration-interface-service-worker-registration">#dfn-service-worker-registration-interface-service-worker-registration</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-registration-interface-service-worker-registration">3.2.4. scope</a>
    <li><a href="#ref-for-dfn-service-worker-registration-interface-service-worker-registration">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-service-worker-registration-interface-service-worker-registration">3.2.6. unregister()</a>
    <li><a href="#ref-for-dfn-service-worker-registration-interface-service-worker-registration">3.6. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-installing-attribute">
   <b><a href="#service-worker-registration-installing-attribute">#service-worker-registration-installing-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-installing-attribute">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-installing-attribute①">3.2.1. installing</a>
    <li><a href="#ref-for-service-worker-registration-installing-attribute">Update Registration State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-waiting-attribute">
   <b><a href="#service-worker-registration-waiting-attribute">#service-worker-registration-waiting-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-waiting-attribute">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-waiting-attribute①">3.2.2. waiting</a>
    <li><a href="#ref-for-service-worker-registration-waiting-attribute">Update Registration State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-active-attribute">
   <b><a href="#service-worker-registration-active-attribute">#service-worker-registration-active-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-active-attribute">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-active-attribute①">3.2.3. active</a>
    <li><a href="#ref-for-service-worker-registration-active-attribute">Update Registration State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-scope-attribute">
   <b><a href="#service-worker-registration-scope-attribute">#service-worker-registration-scope-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-scope-attribute">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-scope-attribute①">3.2.4. scope</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-update-method">
   <b><a href="#service-worker-registration-update-method">#service-worker-registration-update-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-update-method">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-update-method①">3.2.5. update()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-unregister-method">
   <b><a href="#service-worker-registration-unregister-method">#service-worker-registration-unregister-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-unregister-method">3.2. ServiceWorkerRegistration</a>
    <li><a href="#ref-for-service-worker-registration-unregister-method①">3.2.6. unregister()</a> <a href="#ref-for-service-worker-registration-unregister-method②">(2)</a> <a href="#ref-for-service-worker-registration-unregister-method③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-onupdatefound-attribute">
   <b><a href="#service-worker-registration-onupdatefound-attribute">#service-worker-registration-onupdatefound-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-onupdatefound-attribute">3.2. ServiceWorkerRegistration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="navigator-service-worker-attribute">
   <b><a href="#navigator-service-worker-attribute">#navigator-service-worker-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-navigator-service-worker-attribute">3.3. navigator.serviceWorker</a> <a href="#ref-for-navigator-service-worker-attribute①">(2)</a> <a href="#ref-for-navigator-service-worker-attribute②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-serviceworkercontainer-registrationoptions">
   <b><a href="#dictdef-serviceworkercontainer-registrationoptions">#dictdef-serviceworkercontainer-registrationoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-serviceworkercontainer-registrationoptions">3.4. ServiceWorkerContainer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-registrationoptions-scope">
   <b><a href="#dom-registrationoptions-scope">#dom-registrationoptions-scope</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-registrationoptions-scope">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-dom-registrationoptions-scope①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-interface">
   <b><a href="#service-worker-container-interface">#service-worker-container-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-interface">3.3. navigator.serviceWorker</a> <a href="#ref-for-service-worker-container-interface①">(2)</a> <a href="#ref-for-service-worker-container-interface②">(3)</a>
    <li><a href="#ref-for-service-worker-container-interface③">3.4. ServiceWorkerContainer</a> <a href="#ref-for-service-worker-container-interface④">(2)</a> <a href="#ref-for-service-worker-container-interface⑤">(3)</a> <a href="#ref-for-service-worker-container-interface⑥">(4)</a> <a href="#ref-for-service-worker-container-interface⑦">(5)</a> <a href="#ref-for-service-worker-container-interface⑧">(6)</a> <a href="#ref-for-service-worker-container-interface⑨">(7)</a> <a href="#ref-for-service-worker-container-interface①⓪">(8)</a> <a href="#ref-for-service-worker-container-interface①①">(9)</a>
    <li><a href="#ref-for-service-worker-container-interface">3.4.7. Event handlers</a>
    <li><a href="#ref-for-service-worker-container-interface①②">3.6. Events</a>
    <li><a href="#ref-for-service-worker-container-interface①③">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-service-worker-container-interface">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-container-interface-client">
   <b><a href="#dfn-service-worker-container-interface-client">#dfn-service-worker-container-interface-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.4.1. controller</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.4.2. ready</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.4.3. register(scriptURL, options)</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.4.4. getRegistration(clientURL)</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">3.6. Events</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-service-worker-container-interface-client">Notify Controller Change</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-ready-promise">
   <b><a href="#dfn-ready-promise">#dfn-ready-promise</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-ready-promise">3.4.2. ready</a> <a href="#ref-for-dfn-ready-promise">(2)</a> <a href="#ref-for-dfn-ready-promise">(3)</a> <a href="#ref-for-dfn-ready-promise">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-client-message-queue">
   <b><a href="#dfn-client-message-queue">#dfn-client-message-queue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-client-message-queue">3.4. ServiceWorkerContainer</a> <a href="#ref-for-dfn-client-message-queue①">(2)</a> <a href="#ref-for-dfn-client-message-queue②">(3)</a>
    <li><a href="#ref-for-dfn-client-message-queue③">3.4.6. startMessages()</a>
    <li><a href="#ref-for-dfn-client-message-queue④">3.4.7. Event handlers</a>
    <li><a href="#ref-for-dfn-client-message-queue⑤">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-controller-attribute">
   <b><a href="#service-worker-container-controller-attribute">#service-worker-container-controller-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-controller-attribute">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-controller-attribute①">3.4.1. controller</a> <a href="#ref-for-service-worker-container-controller-attribute②">(2)</a>
    <li><a href="#ref-for-service-worker-container-controller-attribute③">3.6. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-ready-attribute">
   <b><a href="#service-worker-container-ready-attribute">#service-worker-container-ready-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-ready-attribute">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-ready-attribute①">3.4.2. ready</a> <a href="#ref-for-service-worker-container-ready-attribute">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-register-method">
   <b><a href="#service-worker-container-register-method">#service-worker-container-register-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-register-method">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-register-method①">3.4.3. register(scriptURL, options)</a> <a href="#ref-for-service-worker-container-register-method②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-getregistration-method">
   <b><a href="#service-worker-container-getregistration-method">#service-worker-container-getregistration-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-getregistration-method">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-getregistration-method①">3.4.4. getRegistration(clientURL)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-getregistrations-method">
   <b><a href="#service-worker-container-getregistrations-method">#service-worker-container-getregistrations-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-getregistrations-method">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-getregistrations-method①">3.4.5. getRegistrations()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-startMessages-method">
   <b><a href="#service-worker-container-startMessages-method">#service-worker-container-startMessages-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-startMessages-method">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-startMessages-method①">3.4.6. startMessages()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-oncontrollerchange-attribute">
   <b><a href="#service-worker-container-oncontrollerchange-attribute">#service-worker-container-oncontrollerchange-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-oncontrollerchange-attribute">3.4. ServiceWorkerContainer</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-onmessage-attribute">
   <b><a href="#service-worker-container-onmessage-attribute">#service-worker-container-onmessage-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-onmessage-attribute">3.4. ServiceWorkerContainer</a>
    <li><a href="#ref-for-service-worker-container-onmessage-attribute">3.4.7. Event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-serviceworkermessageevent-serviceworkermessageeventinit">
   <b><a href="#dictdef-serviceworkermessageevent-serviceworkermessageeventinit">#dictdef-serviceworkermessageevent-serviceworkermessageeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-serviceworkermessageevent-serviceworkermessageeventinit">3.5. ServiceWorkerMessageEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-interface">
   <b><a href="#serviceworkermessage-event-interface">#serviceworkermessage-event-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-interface">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-serviceworkermessage-event-interface①">(2)</a>
    <li><a href="#ref-for-serviceworkermessage-event-interface②">3.6. Events</a>
    <li><a href="#ref-for-serviceworkermessage-event-interface③">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-data-attribute">
   <b><a href="#serviceworkermessage-event-data-attribute">#serviceworkermessage-event-data-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-data-attribute">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-serviceworkermessage-event-data-attribute①">3.5.1. event.data</a>
    <li><a href="#ref-for-serviceworkermessage-event-data-attribute②">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-origin-attribute">
   <b><a href="#serviceworkermessage-event-origin-attribute">#serviceworkermessage-event-origin-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-origin-attribute">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-serviceworkermessage-event-origin-attribute①">3.5.2. event.origin</a>
    <li><a href="#ref-for-serviceworkermessage-event-origin-attribute②">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-lasteventid-attribute">
   <b><a href="#serviceworkermessage-event-lasteventid-attribute">#serviceworkermessage-event-lasteventid-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-lasteventid-attribute">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-serviceworkermessage-event-lasteventid-attribute①">3.5.3. event.lastEventId</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-source-attribute">
   <b><a href="#serviceworkermessage-event-source-attribute">#serviceworkermessage-event-source-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-source-attribute">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-serviceworkermessage-event-source-attribute①">3.5.4. event.source</a>
    <li><a href="#ref-for-serviceworkermessage-event-source-attribute②">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="serviceworkermessage-event-ports-attribute">
   <b><a href="#serviceworkermessage-event-ports-attribute">#serviceworkermessage-event-ports-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-serviceworkermessage-event-ports-attribute">3.5. ServiceWorkerMessageEvent</a>
    <li><a href="#ref-for-serviceworkermessage-event-ports-attribute①">3.5.5. event.ports</a>
    <li><a href="#ref-for-serviceworkermessage-event-ports-attribute②">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-statechange-event">
   <b><a href="#service-worker-statechange-event">#service-worker-statechange-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-statechange-event">3.1.4. Event handler</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-registration-updatefound-event">
   <b><a href="#service-worker-registration-updatefound-event">#service-worker-registration-updatefound-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-registration-updatefound-event">3.2.7. Event handler</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-controllerchange-event">
   <b><a href="#service-worker-container-controllerchange-event">#service-worker-container-controllerchange-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-controllerchange-event">3.4.7. Event handlers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-container-message-event">
   <b><a href="#service-worker-container-message-event">#service-worker-container-message-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-container-message-event">3.4.7. Event handlers</a>
    <li><a href="#ref-for-service-worker-container-message-event">3.5. ServiceWorkerMessageEvent</a> <a href="#ref-for-service-worker-container-message-event">(2)</a>
    <li><a href="#ref-for-service-worker-container-message-event">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-interface">
   <b><a href="#service-worker-global-scope-interface">#service-worker-global-scope-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-interface">3.1.3. postMessage(message, transfer)</a> <a href="#ref-for-service-worker-global-scope-interface①">(2)</a>
    <li><a href="#ref-for-service-worker-global-scope-interface②">3.2.5. update()</a>
    <li><a href="#ref-for-service-worker-global-scope-interface③">4.1. ServiceWorkerGlobalScope</a> <a href="#ref-for-service-worker-global-scope-interface④">(2)</a> <a href="#ref-for-service-worker-global-scope-interface⑤">(3)</a> <a href="#ref-for-service-worker-global-scope-interface⑥">(4)</a>
    <li><a href="#ref-for-service-worker-global-scope-interface">4.1.4. Event handlers</a>
    <li><a href="#ref-for-service-worker-global-scope-interface">4.3. Clients</a>
    <li><a href="#ref-for-service-worker-global-scope-interface⑦">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-service-worker-global-scope-interface">4.7. Events</a>
    <li><a href="#ref-for-service-worker-global-scope-interface⑧">6.3.2. importScripts(urls)</a> <a href="#ref-for-service-worker-global-scope-interface⑨">(2)</a>
    <li><a href="#ref-for-service-worker-global-scope-interface①⓪">8.3. Define Event Handler</a>
    <li><a href="#ref-for-service-worker-global-scope-interface①①">8.4. Request Functional Event Dispatch</a>
    <li><a href="#ref-for-service-worker-global-scope-interface①②">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-global-scope-service-worker">
   <b><a href="#dfn-service-worker-global-scope-service-worker">#dfn-service-worker-global-scope-service-worker</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.1.2. registration</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.2.8. navigate(url)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.3.1. get(id)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.3.2. matchAll(options)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(2)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.3.3. openWindow(url)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.3.4. claim()</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(3)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(4)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(5)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">4.7. Events</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(2)</a> <a href="#ref-for-dfn-service-worker-global-scope-service-worker">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">6.3.2. importScripts(urls)</a>
    <li><a href="#ref-for-dfn-service-worker-global-scope-service-worker">Run Service Worker</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-clients-attribute">
   <b><a href="#service-worker-global-scope-clients-attribute">#service-worker-global-scope-clients-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-clients-attribute">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-global-scope-clients-attribute①">4.1.1. clients</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-scope-attribute">
   <b><a href="#service-worker-global-scope-scope-attribute">#service-worker-global-scope-scope-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-scope-attribute">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-global-scope-scope-attribute①">4.1.2. registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-skipwaiting-method">
   <b><a href="#service-worker-global-scope-skipwaiting-method">#service-worker-global-scope-skipwaiting-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-skipwaiting-method">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-global-scope-skipwaiting-method①">4.1.3. skipWaiting()</a> <a href="#ref-for-service-worker-global-scope-skipwaiting-method②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-oninstall-attribute">
   <b><a href="#service-worker-global-scope-oninstall-attribute">#service-worker-global-scope-oninstall-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-oninstall-attribute">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-global-scope-oninstall-attribute">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-onactivate-attribute">
   <b><a href="#service-worker-global-scope-onactivate-attribute">#service-worker-global-scope-onactivate-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-onactivate-attribute">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-service-worker-global-scope-onactivate-attribute">Update Worker State</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-onfetch-attribute">
   <b><a href="#service-worker-global-scope-onfetch-attribute">#service-worker-global-scope-onfetch-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-onfetch-attribute">4.1. ServiceWorkerGlobalScope</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-onmessage-attribute">
   <b><a href="#service-worker-global-scope-onmessage-attribute">#service-worker-global-scope-onmessage-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-onmessage-attribute">4.1. ServiceWorkerGlobalScope</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-windowclient-navigate">
   <b><a href="#dom-windowclient-navigate">#dom-windowclient-navigate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-windowclient-navigate">4.2.8. navigate(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-interface">
   <b><a href="#client-interface">#client-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-interface">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-client-interface①">4.2. Client</a> <a href="#ref-for-client-interface②">(2)</a> <a href="#ref-for-client-interface③">(3)</a>
    <li><a href="#ref-for-client-interface④">4.3. Clients</a>
    <li><a href="#ref-for-client-interface⑤">4.6. ExtendableMessageEvent</a> <a href="#ref-for-client-interface⑥">(2)</a>
    <li><a href="#ref-for-client-interface⑦">4.6.4. event.source</a>
    <li><a href="#ref-for-client-interface⑧">Create Client</a> <a href="#ref-for-client-interface⑨">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-client">
   <b><a href="#dfn-service-worker-client-client">#dfn-service-worker-client-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.1. url</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.2. frameType</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.3. id</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.4. postMessage(message, transfer)</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.7. focus()</a> <a href="#ref-for-dfn-service-worker-client-client">(2)</a> <a href="#ref-for-dfn-service-worker-client-client">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">4.2.8. navigate(url)</a> <a href="#ref-for-dfn-service-worker-client-client">(2)</a> <a href="#ref-for-dfn-service-worker-client-client">(3)</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">Create Client</a>
    <li><a href="#ref-for-dfn-service-worker-client-client">Create Window Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="window-client-interface">
   <b><a href="#window-client-interface">#window-client-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-window-client-interface">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-window-client-interface①">4.2. Client</a> <a href="#ref-for-window-client-interface②">(2)</a> <a href="#ref-for-window-client-interface③">(3)</a> <a href="#ref-for-window-client-interface④">(4)</a>
    <li><a href="#ref-for-window-client-interface⑤">4.3. Clients</a>
    <li><a href="#ref-for-window-client-interface⑥">Create Window Client</a> <a href="#ref-for-window-client-interface⑦">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-visibilitystate">
   <b><a href="#dfn-service-worker-client-visibilitystate">#dfn-service-worker-client-visibilitystate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-visibilitystate">4.2.5. visibilityState</a>
    <li><a href="#ref-for-dfn-service-worker-client-visibilitystate">Create Window Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-service-worker-client-focusstate">
   <b><a href="#dfn-service-worker-client-focusstate">#dfn-service-worker-client-focusstate</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-service-worker-client-focusstate">4.2.6. focused</a>
    <li><a href="#ref-for-dfn-service-worker-client-focusstate">4.2.7. focus()</a>
    <li><a href="#ref-for-dfn-service-worker-client-focusstate">Create Window Client</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-url-attribute">
   <b><a href="#client-url-attribute">#client-url-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-url-attribute">4.2. Client</a>
    <li><a href="#ref-for-client-url-attribute①">4.2.1. url</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-frametype-attribute">
   <b><a href="#client-frametype-attribute">#client-frametype-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-frametype-attribute">4.2. Client</a>
    <li><a href="#ref-for-client-frametype-attribute①">4.2.2. frameType</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="contextframetype-enum">
   <b><a href="#contextframetype-enum">#contextframetype-enum</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-contextframetype-enum">4.2. Client</a> <a href="#ref-for-contextframetype-enum①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-id-attribute">
   <b><a href="#client-id-attribute">#client-id-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-id-attribute">4.2. Client</a>
    <li><a href="#ref-for-client-id-attribute①">4.2.3. id</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-postmessage-method">
   <b><a href="#client-postmessage-method">#client-postmessage-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-postmessage-method">4.2. Client</a>
    <li><a href="#ref-for-client-postmessage-method①">4.2.4. postMessage(message, transfer)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-visibilitystate-attribute">
   <b><a href="#client-visibilitystate-attribute">#client-visibilitystate-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-visibilitystate-attribute">4.2. Client</a>
    <li><a href="#ref-for-client-visibilitystate-attribute①">4.2.5. visibilityState</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-focused-attribute">
   <b><a href="#client-focused-attribute">#client-focused-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-focused-attribute">4.2. Client</a>
    <li><a href="#ref-for-client-focused-attribute①">4.2.6. focused</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="client-focus-method">
   <b><a href="#client-focus-method">#client-focus-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-client-focus-method">4.2. Client</a>
    <li><a href="#ref-for-client-focus-method①">4.2.7. focus()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-clients-clientqueryoptions">
   <b><a href="#dictdef-clients-clientqueryoptions">#dictdef-clients-clientqueryoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-clients-clientqueryoptions">4.3. Clients</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-clientqueryoptions-includeuncontrolled">
   <b><a href="#dom-clientqueryoptions-includeuncontrolled">#dom-clientqueryoptions-includeuncontrolled</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-clientqueryoptions-includeuncontrolled">4.3.2. matchAll(options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-clientqueryoptions-type">
   <b><a href="#dom-clientqueryoptions-type">#dom-clientqueryoptions-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-clientqueryoptions-type">4.3.2. matchAll(options)</a> <a href="#ref-for-dom-clientqueryoptions-type①">(2)</a> <a href="#ref-for-dom-clientqueryoptions-type②">(3)</a> <a href="#ref-for-dom-clientqueryoptions-type③">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="enumdef-clients-clienttype">
   <b><a href="#enumdef-clients-clienttype">#enumdef-clients-clienttype</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-enumdef-clients-clienttype">4.3. Clients</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clients-interface">
   <b><a href="#clients-interface">#clients-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clients-interface">4.1. ServiceWorkerGlobalScope</a>
    <li><a href="#ref-for-clients-interface①">4.1.1. clients</a>
    <li><a href="#ref-for-clients-interface②">4.3. Clients</a> <a href="#ref-for-clients-interface③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clients-get-method">
   <b><a href="#clients-get-method">#clients-get-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clients-get-method">4.3. Clients</a>
    <li><a href="#ref-for-clients-get-method①">4.3.1. get(id)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clients-matchall-method">
   <b><a href="#clients-matchall-method">#clients-matchall-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clients-matchall-method">4.3. Clients</a>
    <li><a href="#ref-for-clients-matchall-method①">4.3.2. matchAll(options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clients-openwindow-method">
   <b><a href="#clients-openwindow-method">#clients-openwindow-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clients-openwindow-method">4.3. Clients</a>
    <li><a href="#ref-for-clients-openwindow-method①">4.3.3. openWindow(url)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="clients-claim-method">
   <b><a href="#clients-claim-method">#clients-claim-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-clients-claim-method">4.3. Clients</a>
    <li><a href="#ref-for-clients-claim-method①">4.3.4. claim()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-extendableeventinit">
   <b><a href="#dictdef-extendableeventinit">#dictdef-extendableeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-extendableeventinit">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-dictdef-extendableeventinit①">4.5. FetchEvent</a>
    <li><a href="#ref-for-dictdef-extendableeventinit②">4.6. ExtendableMessageEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendable-event-interface">
   <b><a href="#extendable-event-interface">#extendable-event-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendable-event-interface">4.4. ExtendableEvent</a> <a href="#ref-for-extendable-event-interface①">(2)</a> <a href="#ref-for-extendable-event-interface②">(3)</a> <a href="#ref-for-extendable-event-interface③">(4)</a> <a href="#ref-for-extendable-event-interface④">(5)</a> <a href="#ref-for-extendable-event-interface⑤">(6)</a>
    <li><a href="#ref-for-extendable-event-interface⑥">4.5. FetchEvent</a> <a href="#ref-for-extendable-event-interface⑦">(2)</a>
    <li><a href="#ref-for-extendable-event-interface⑧">4.6. ExtendableMessageEvent</a> <a href="#ref-for-extendable-event-interface⑨">(2)</a>
    <li><a href="#ref-for-extendable-event-interface①⓪">4.7. Events</a> <a href="#ref-for-extendable-event-interface①①">(2)</a>
    <li><a href="#ref-for-extendable-event-interface①②">8.2. Define Functional Event</a>
    <li><a href="#ref-for-extendable-event-interface①③">Install</a>
    <li><a href="#ref-for-extendable-event-interface①④">Activate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-extend-lifetime-promises">
   <b><a href="#dfn-extend-lifetime-promises">#dfn-extend-lifetime-promises</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-extend-lifetime-promises">4.4. ExtendableEvent</a> <a href="#ref-for-dfn-extend-lifetime-promises①">(2)</a> <a href="#ref-for-dfn-extend-lifetime-promises②">(3)</a> <a href="#ref-for-dfn-extend-lifetime-promises">(4)</a> <a href="#ref-for-dfn-extend-lifetime-promises">(5)</a> <a href="#ref-for-dfn-extend-lifetime-promises③">(6)</a> <a href="#ref-for-dfn-extend-lifetime-promises④">(7)</a> <a href="#ref-for-dfn-extend-lifetime-promises⑤">(8)</a> <a href="#ref-for-dfn-extend-lifetime-promises⑥">(9)</a>
    <li><a href="#ref-for-dfn-extend-lifetime-promises">4.4.1. event.waitUntil(f)</a>
    <li><a href="#ref-for-dfn-extend-lifetime-promises⑦">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-dfn-extend-lifetime-promises⑧">Install</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extensions-allowed-flag">
   <b><a href="#extensions-allowed-flag">#extensions-allowed-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extensions-allowed-flag">4.4. ExtendableEvent</a> <a href="#ref-for-extensions-allowed-flag①">(2)</a> <a href="#ref-for-extensions-allowed-flag②">(3)</a>
    <li><a href="#ref-for-extensions-allowed-flag③">4.4.1. event.waitUntil(f)</a>
    <li><a href="#ref-for-extensions-allowed-flag④">Install</a>
    <li><a href="#ref-for-extensions-allowed-flag⑤">Activate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendable-event-waituntil-method">
   <b><a href="#extendable-event-waituntil-method">#extendable-event-waituntil-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendable-event-waituntil-method">4.4. ExtendableEvent</a>
    <li><a href="#ref-for-extendable-event-waituntil-method①">4.4.1. event.waitUntil(f)</a> <a href="#ref-for-extendable-event-waituntil-method②">(2)</a>
    <li><a href="#ref-for-extendable-event-waituntil-method③">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-extendable-event-waituntil-method">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendable-event-waituntil-method">Update Worker State</a> <a href="#ref-for-extendable-event-waituntil-method">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-fetchevent-fetcheventinit">
   <b><a href="#dictdef-fetchevent-fetcheventinit">#dictdef-fetchevent-fetcheventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-fetchevent-fetcheventinit">4.5. FetchEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetch-event-interface">
   <b><a href="#fetch-event-interface">#fetch-event-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-event-interface">4.5. FetchEvent</a> <a href="#ref-for-fetch-event-interface①">(2)</a> <a href="#ref-for-fetch-event-interface②">(3)</a>
    <li><a href="#ref-for-fetch-event-interface③">4.7. Events</a>
    <li><a href="#ref-for-fetch-event-interface④">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetchevent-potential-response">
   <b><a href="#fetchevent-potential-response">#fetchevent-potential-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetchevent-potential-response">4.5.4. event.respondWith(r)</a>
    <li><a href="#ref-for-fetchevent-potential-response①">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="wait-to-respond-flag">
   <b><a href="#wait-to-respond-flag">#wait-to-respond-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-wait-to-respond-flag">4.5.4. event.respondWith(r)</a> <a href="#ref-for-wait-to-respond-flag">(2)</a>
    <li><a href="#ref-for-wait-to-respond-flag">Handle Fetch</a> <a href="#ref-for-wait-to-respond-flag">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="respond-with-entered-flag">
   <b><a href="#respond-with-entered-flag">#respond-with-entered-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-respond-with-entered-flag">4.5.4. event.respondWith(r)</a> <a href="#ref-for-respond-with-entered-flag">(2)</a>
    <li><a href="#ref-for-respond-with-entered-flag">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="respond-with-error-flag">
   <b><a href="#respond-with-error-flag">#respond-with-error-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-respond-with-error-flag">4.5.4. event.respondWith(r)</a> <a href="#ref-for-respond-with-error-flag">(2)</a> <a href="#ref-for-respond-with-error-flag">(3)</a> <a href="#ref-for-respond-with-error-flag">(4)</a>
    <li><a href="#ref-for-respond-with-error-flag">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetch-event-request-attribute">
   <b><a href="#fetch-event-request-attribute">#fetch-event-request-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-event-request-attribute">4.5. FetchEvent</a>
    <li><a href="#ref-for-fetch-event-request-attribute①">4.5.1. event.request</a>
    <li><a href="#ref-for-fetch-event-request-attribute">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetch-event-clientid-attribute">
   <b><a href="#fetch-event-clientid-attribute">#fetch-event-clientid-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-event-clientid-attribute">4.5. FetchEvent</a>
    <li><a href="#ref-for-fetch-event-clientid-attribute①">4.5.2. event.clientId</a>
    <li><a href="#ref-for-fetch-event-clientid-attribute">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetch-event-isreload-attribute">
   <b><a href="#fetch-event-isreload-attribute">#fetch-event-isreload-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-event-isreload-attribute">4.5. FetchEvent</a>
    <li><a href="#ref-for-fetch-event-isreload-attribute①">4.5.3. event.isReload</a>
    <li><a href="#ref-for-fetch-event-isreload-attribute">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fetch-event-respondwith-method">
   <b><a href="#fetch-event-respondwith-method">#fetch-event-respondwith-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fetch-event-respondwith-method">4.5. FetchEvent</a>
    <li><a href="#ref-for-fetch-event-respondwith-method①">4.5.4. event.respondWith(r)</a> <a href="#ref-for-fetch-event-respondwith-method②">(2)</a>
    <li><a href="#ref-for-fetch-event-respondwith-method③">6.4. Cross-Origin Resources and CORS</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-extendablemessageevent-extendablemessageeventinit">
   <b><a href="#dictdef-extendablemessageevent-extendablemessageeventinit">#dictdef-extendablemessageevent-extendablemessageeventinit</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-extendablemessageevent-extendablemessageeventinit">4.6. ExtendableMessageEvent</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-interface">
   <b><a href="#extendablemessage-event-interface">#extendablemessage-event-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-interface">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-extendablemessage-event-interface①">4.6. ExtendableMessageEvent</a> <a href="#ref-for-extendablemessage-event-interface②">(2)</a>
    <li><a href="#ref-for-extendablemessage-event-interface③">4.7. Events</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-data-attribute">
   <b><a href="#extendablemessage-event-data-attribute">#extendablemessage-event-data-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-data-attribute">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-extendablemessage-event-data-attribute①">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendablemessage-event-data-attribute②">4.6.1. event.data</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-origin-attribute">
   <b><a href="#extendablemessage-event-origin-attribute">#extendablemessage-event-origin-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-origin-attribute">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-extendablemessage-event-origin-attribute①">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendablemessage-event-origin-attribute②">4.6.2. event.origin</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-lasteventid-attribute">
   <b><a href="#extendablemessage-event-lasteventid-attribute">#extendablemessage-event-lasteventid-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-lasteventid-attribute">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendablemessage-event-lasteventid-attribute①">4.6.3. event.lastEventId</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-source-attribute">
   <b><a href="#extendablemessage-event-source-attribute">#extendablemessage-event-source-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-source-attribute">3.1.3. postMessage(message, transfer)</a> <a href="#ref-for-extendablemessage-event-source-attribute①">(2)</a>
    <li><a href="#ref-for-extendablemessage-event-source-attribute②">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendablemessage-event-source-attribute③">4.6.4. event.source</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="extendablemessage-event-ports-attribute">
   <b><a href="#extendablemessage-event-ports-attribute">#extendablemessage-event-ports-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-extendablemessage-event-ports-attribute">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-extendablemessage-event-ports-attribute①">4.6. ExtendableMessageEvent</a>
    <li><a href="#ref-for-extendablemessage-event-ports-attribute②">4.6.5. event.ports</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-install-event">
   <b><a href="#service-worker-global-scope-install-event">#service-worker-global-scope-install-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-install-event">2.1. Service Worker</a>
    <li><a href="#ref-for-service-worker-global-scope-install-event">4.1.4. Event handlers</a>
    <li><a href="#ref-for-service-worker-global-scope-install-event">4.4. ExtendableEvent</a> <a href="#ref-for-service-worker-global-scope-install-event">(2)</a> <a href="#ref-for-service-worker-global-scope-install-event">(3)</a>
    <li><a href="#ref-for-service-worker-global-scope-install-event">Install</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-activate-event">
   <b><a href="#service-worker-global-scope-activate-event">#service-worker-global-scope-activate-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-activate-event">2.1. Service Worker</a>
    <li><a href="#ref-for-service-worker-global-scope-activate-event">4.1.4. Event handlers</a>
    <li><a href="#ref-for-service-worker-global-scope-activate-event">4.4. ExtendableEvent</a> <a href="#ref-for-service-worker-global-scope-activate-event">(2)</a> <a href="#ref-for-service-worker-global-scope-activate-event">(3)</a>
    <li><a href="#ref-for-service-worker-global-scope-activate-event">Activate</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-fetch-event">
   <b><a href="#service-worker-global-scope-fetch-event">#service-worker-global-scope-fetch-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">2.1. Service Worker</a>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">2.5. Task Sources</a>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">4.1.4. Event handlers</a>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">4.5. FetchEvent</a> <a href="#ref-for-service-worker-global-scope-fetch-event">(2)</a>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">6.5. Implementer Concerns</a>
    <li><a href="#ref-for-service-worker-global-scope-fetch-event">Handle Fetch</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="service-worker-global-scope-message-event">
   <b><a href="#service-worker-global-scope-message-event">#service-worker-global-scope-message-event</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-service-worker-global-scope-message-event">3.1.3. postMessage(message, transfer)</a>
    <li><a href="#ref-for-service-worker-global-scope-message-event">4.1.4. Event handlers</a>
    <li><a href="#ref-for-service-worker-global-scope-message-event">4.6. ExtendableMessageEvent</a> <a href="#ref-for-service-worker-global-scope-message-event">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-fetching-record">
   <b><a href="#dfn-fetching-record">#dfn-fetching-record</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-fetching-record">5.1. Constructs</a> <a href="#ref-for-dfn-fetching-record">(2)</a> <a href="#ref-for-dfn-fetching-record">(3)</a>
    <li><a href="#ref-for-dfn-fetching-record">5.4.2. matchAll(request, options)</a> <a href="#ref-for-dfn-fetching-record">(2)</a>
    <li><a href="#ref-for-dfn-fetching-record">5.4.4. addAll(requests)</a> <a href="#ref-for-dfn-fetching-record">(2)</a>
    <li><a href="#ref-for-dfn-fetching-record">5.4.5. put(request, response)</a> <a href="#ref-for-dfn-fetching-record">(2)</a>
    <li><a href="#ref-for-dfn-fetching-record">5.4.7. keys(request, options)</a>
    <li><a href="#ref-for-dfn-fetching-record">Query Cache</a>
    <li><a href="#ref-for-dfn-fetching-record">Batch Cache Operations</a> <a href="#ref-for-dfn-fetching-record">(2)</a> <a href="#ref-for-dfn-fetching-record">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-incumbent-record">
   <b><a href="#dfn-incumbent-record">#dfn-incumbent-record</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-incumbent-record">5.4.2. matchAll(request, options)</a>
    <li><a href="#ref-for-dfn-incumbent-record">5.4.4. addAll(requests)</a> <a href="#ref-for-dfn-incumbent-record">(2)</a>
    <li><a href="#ref-for-dfn-incumbent-record">5.4.5. put(request, response)</a> <a href="#ref-for-dfn-incumbent-record">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-request-to-response-map">
   <b><a href="#dfn-request-to-response-map">#dfn-request-to-response-map</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-request-to-response-map">5.4. Cache</a> <a href="#ref-for-dfn-request-to-response-map">(2)</a>
    <li><a href="#ref-for-dfn-request-to-response-map">5.4.2. matchAll(request, options)</a> <a href="#ref-for-dfn-request-to-response-map">(2)</a>
    <li><a href="#ref-for-dfn-request-to-response-map">5.4.4. addAll(requests)</a> <a href="#ref-for-dfn-request-to-response-map">(2)</a> <a href="#ref-for-dfn-request-to-response-map">(3)</a> <a href="#ref-for-dfn-request-to-response-map">(4)</a> <a href="#ref-for-dfn-request-to-response-map">(5)</a>
    <li><a href="#ref-for-dfn-request-to-response-map">5.4.5. put(request, response)</a> <a href="#ref-for-dfn-request-to-response-map">(2)</a> <a href="#ref-for-dfn-request-to-response-map">(3)</a> <a href="#ref-for-dfn-request-to-response-map">(4)</a> <a href="#ref-for-dfn-request-to-response-map">(5)</a>
    <li><a href="#ref-for-dfn-request-to-response-map">5.4.7. keys(request, options)</a>
    <li><a href="#ref-for-dfn-request-to-response-map">6.6. Privacy</a>
    <li><a href="#ref-for-dfn-request-to-response-map">Query Cache</a>
    <li><a href="#ref-for-dfn-request-to-response-map">Batch Cache Operations</a> <a href="#ref-for-dfn-request-to-response-map">(2)</a> <a href="#ref-for-dfn-request-to-response-map">(3)</a> <a href="#ref-for-dfn-request-to-response-map">(4)</a> <a href="#ref-for-dfn-request-to-response-map">(5)</a> <a href="#ref-for-dfn-request-to-response-map">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-name-to-cache-map">
   <b><a href="#dfn-name-to-cache-map">#dfn-name-to-cache-map</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.1. Constructs</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5. CacheStorage</a> <a href="#ref-for-dfn-name-to-cache-map">(2)</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5.1. match(request, options)</a> <a href="#ref-for-dfn-name-to-cache-map">(2)</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5.2. has(cacheName)</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5.3. open(cacheName)</a> <a href="#ref-for-dfn-name-to-cache-map">(2)</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5.4. delete(cacheName)</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">5.5.5. keys()</a>
    <li><a href="#ref-for-dfn-name-to-cache-map">6.6. Privacy</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="global-caches-attribute">
   <b><a href="#global-caches-attribute">#global-caches-attribute</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-global-caches-attribute">5.3. self.caches</a> <a href="#ref-for-global-caches-attribute①">(2)</a>
    <li><a href="#ref-for-global-caches-attribute②">5.3.1. caches</a>
    <li><a href="#ref-for-global-caches-attribute③">5.4. Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cache-cachequeryoptions">
   <b><a href="#dictdef-cache-cachequeryoptions">#dictdef-cache-cachequeryoptions</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cache-cachequeryoptions">5.4. Cache</a> <a href="#ref-for-dictdef-cache-cachequeryoptions①">(2)</a> <a href="#ref-for-dictdef-cache-cachequeryoptions②">(3)</a> <a href="#ref-for-dictdef-cache-cachequeryoptions③">(4)</a> <a href="#ref-for-dictdef-cache-cachequeryoptions④">(5)</a>
    <li><a href="#ref-for-dictdef-cache-cachequeryoptions⑤">5.5. CacheStorage</a>
    <li><a href="#ref-for-dictdef-cache-cachequeryoptions⑥">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachequeryoptions-ignoresearch">
   <b><a href="#dom-cachequeryoptions-ignoresearch">#dom-cachequeryoptions-ignoresearch</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachequeryoptions-ignoresearch">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachequeryoptions-ignoremethod">
   <b><a href="#dom-cachequeryoptions-ignoremethod">#dom-cachequeryoptions-ignoremethod</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachequeryoptions-ignoremethod">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachequeryoptions-ignorevary">
   <b><a href="#dom-cachequeryoptions-ignorevary">#dom-cachequeryoptions-ignorevary</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachequeryoptions-ignorevary">Query Cache</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachequeryoptions-cachename">
   <b><a href="#dom-cachequeryoptions-cachename">#dom-cachequeryoptions-cachename</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachequeryoptions-cachename">5.5.1. match(request, options)</a> <a href="#ref-for-dom-cachequeryoptions-cachename①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dictdef-cache-cachebatchoperation">
   <b><a href="#dictdef-cache-cachebatchoperation">#dictdef-cache-cachebatchoperation</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dictdef-cache-cachebatchoperation">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-dictdef-cache-cachebatchoperation①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-dictdef-cache-cachebatchoperation②">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-dictdef-cache-cachebatchoperation③">Batch Cache Operations</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachebatchoperation-type">
   <b><a href="#dom-cachebatchoperation-type">#dom-cachebatchoperation-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachebatchoperation-type">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-type①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-type②">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-type③">Batch Cache Operations</a> <a href="#ref-for-dom-cachebatchoperation-type④">(2)</a> <a href="#ref-for-dom-cachebatchoperation-type⑤">(3)</a> <a href="#ref-for-dom-cachebatchoperation-type⑥">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachebatchoperation-request">
   <b><a href="#dom-cachebatchoperation-request">#dom-cachebatchoperation-request</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachebatchoperation-request">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-request①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-request②">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-request③">Batch Cache Operations</a> <a href="#ref-for-dom-cachebatchoperation-request④">(2)</a> <a href="#ref-for-dom-cachebatchoperation-request⑤">(3)</a> <a href="#ref-for-dom-cachebatchoperation-request⑥">(4)</a> <a href="#ref-for-dom-cachebatchoperation-request⑦">(5)</a> <a href="#ref-for-dom-cachebatchoperation-request⑧">(6)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachebatchoperation-response">
   <b><a href="#dom-cachebatchoperation-response">#dom-cachebatchoperation-response</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachebatchoperation-response">5.4.4. addAll(requests)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-response①">5.4.5. put(request, response)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-response②">Batch Cache Operations</a> <a href="#ref-for-dom-cachebatchoperation-response③">(2)</a> <a href="#ref-for-dom-cachebatchoperation-response④">(3)</a> <a href="#ref-for-dom-cachebatchoperation-response⑤">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dom-cachebatchoperation-options">
   <b><a href="#dom-cachebatchoperation-options">#dom-cachebatchoperation-options</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-cachebatchoperation-options">5.4.6. delete(request, options)</a>
    <li><a href="#ref-for-dom-cachebatchoperation-options①">Batch Cache Operations</a> <a href="#ref-for-dom-cachebatchoperation-options②">(2)</a> <a href="#ref-for-dom-cachebatchoperation-options③">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-interface">
   <b><a href="#cache-interface">#cache-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-interface">4.7. Events</a>
    <li><a href="#ref-for-cache-interface①">5. Caches</a> <a href="#ref-for-cache-interface②">(2)</a>
    <li><a href="#ref-for-cache-interface③">5.1. Constructs</a> <a href="#ref-for-cache-interface④">(2)</a>
    <li><a href="#ref-for-cache-interface⑤">5.2. Understanding Cache Lifetimes</a> <a href="#ref-for-cache-interface⑥">(2)</a> <a href="#ref-for-cache-interface⑦">(3)</a> <a href="#ref-for-cache-interface⑧">(4)</a> <a href="#ref-for-cache-interface⑨">(5)</a>
    <li><a href="#ref-for-cache-interface①⓪">5.4. Cache</a> <a href="#ref-for-cache-interface①①">(2)</a> <a href="#ref-for-cache-interface①②">(3)</a> <a href="#ref-for-cache-interface①③">(4)</a>
    <li><a href="#ref-for-cache-interface①④">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-interface①⑤">5.5.1. match(request, options)</a> <a href="#ref-for-cache-interface①⑥">(2)</a>
    <li><a href="#ref-for-cache-interface①⑦">5.5.3. open(cacheName)</a> <a href="#ref-for-cache-interface①⑧">(2)</a>
    <li><a href="#ref-for-cache-interface①⑨">6.4. Cross-Origin Resources and CORS</a> <a href="#ref-for-cache-interface②⓪">(2)</a> <a href="#ref-for-cache-interface②①">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-match-method">
   <b><a href="#cache-match-method">#cache-match-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-match-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-match-method①">5.4.1. match(request, options)</a>
    <li><a href="#ref-for-cache-match-method②">5.5.1. match(request, options)</a> <a href="#ref-for-cache-match-method③">(2)</a> <a href="#ref-for-cache-match-method④">(3)</a> <a href="#ref-for-cache-match-method⑤">(4)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-matchall-method">
   <b><a href="#cache-matchall-method">#cache-matchall-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-matchall-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-matchall-method①">5.4.1. match(request, options)</a>
    <li><a href="#ref-for-cache-matchall-method②">5.4.2. matchAll(request, options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-add-method">
   <b><a href="#cache-add-method">#cache-add-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-add-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-add-method①">5.4.3. add(request)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-addAll-method">
   <b><a href="#cache-addAll-method">#cache-addAll-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-addAll-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-addAll-method①">5.4.3. add(request)</a>
    <li><a href="#ref-for-cache-addAll-method②">5.4.4. addAll(requests)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-put-method">
   <b><a href="#cache-put-method">#cache-put-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-put-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-put-method①">5.4.5. put(request, response)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-delete-method">
   <b><a href="#cache-delete-method">#cache-delete-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-delete-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-delete-method①">5.4.6. delete(request, options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-keys-method">
   <b><a href="#cache-keys-method">#cache-keys-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-keys-method">5.4. Cache</a>
    <li><a href="#ref-for-cache-keys-method①">5.4.7. keys(request, options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cachestorage-global-object">
   <b><a href="#cachestorage-global-object">#cachestorage-global-object</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cachestorage-global-object">5.5. CacheStorage</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-interface">
   <b><a href="#cache-storage-interface">#cache-storage-interface</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-interface">5.3. self.caches</a>
    <li><a href="#ref-for-cache-storage-interface①">5.3.1. caches</a>
    <li><a href="#ref-for-cache-storage-interface②">5.5. CacheStorage</a> <a href="#ref-for-cache-storage-interface③">(2)</a> <a href="#ref-for-cache-storage-interface④">(3)</a> <a href="#ref-for-cache-storage-interface⑤">(4)</a> <a href="#ref-for-cache-storage-interface⑥">(5)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-match-method">
   <b><a href="#cache-storage-match-method">#cache-storage-match-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-match-method">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-storage-match-method①">5.5.1. match(request, options)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-has-method">
   <b><a href="#cache-storage-has-method">#cache-storage-has-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-has-method">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-storage-has-method①">5.5.2. has(cacheName)</a>
    <li><a href="#ref-for-cache-storage-has-method②">5.5.4. delete(cacheName)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-open-method">
   <b><a href="#cache-storage-open-method">#cache-storage-open-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-open-method">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-storage-open-method①">5.5.3. open(cacheName)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-delete-method">
   <b><a href="#cache-storage-delete-method">#cache-storage-delete-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-delete-method">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-storage-delete-method①">5.5.4. delete(cacheName)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="cache-storage-keys-method">
   <b><a href="#cache-storage-keys-method">#cache-storage-keys-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-cache-storage-keys-method">5.5. CacheStorage</a>
    <li><a href="#ref-for-cache-storage-keys-method①">5.5.5. keys()</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="importscripts-method">
   <b><a href="#importscripts-method">#importscripts-method</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-importscripts-method">6.3.1. Origin restriction</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-scope-to-registration-map">
   <b><a href="#dfn-scope-to-registration-map">#dfn-scope-to-registration-map</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-scope-to-registration-map">2.2.1. Lifetime</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">2.4. Selection and Use</a> <a href="#ref-for-dfn-scope-to-registration-map">(2)</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">3.4.2. ready</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">3.4.5. getRegistrations()</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">6.6. Privacy</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Handle Functional Event</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Handle User Agent Shutdown</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Set Registration</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Clear Registration</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Match Service Worker Registration</a>
    <li><a href="#ref-for-dfn-scope-to-registration-map">Get Registration</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job">
   <b><a href="#dfn-job">#dfn-job</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job">Appendix A: Algorithms</a> <a href="#ref-for-dfn-job">(2)</a> <a href="#ref-for-dfn-job">(3)</a> <a href="#ref-for-dfn-job">(4)</a> <a href="#ref-for-dfn-job">(5)</a> <a href="#ref-for-dfn-job">(6)</a> <a href="#ref-for-dfn-job">(7)</a> <a href="#ref-for-dfn-job">(8)</a> <a href="#ref-for-dfn-job">(9)</a> <a href="#ref-for-dfn-job">(10)</a> <a href="#ref-for-dfn-job">(11)</a> <a href="#ref-for-dfn-job">(12)</a> <a href="#ref-for-dfn-job">(13)</a> <a href="#ref-for-dfn-job">(14)</a> <a href="#ref-for-dfn-job">(15)</a>
    <li><a href="#ref-for-dfn-job">Create Job</a> <a href="#ref-for-dfn-job">(2)</a>
    <li><a href="#ref-for-dfn-job">Schedule Job</a>
    <li><a href="#ref-for-dfn-job">Finish Job</a>
    <li><a href="#ref-for-dfn-job">Resolve Job Promise</a>
    <li><a href="#ref-for-dfn-job">Reject Job Promise</a>
    <li><a href="#ref-for-dfn-job">Register</a>
    <li><a href="#ref-for-dfn-job">Update</a>
    <li><a href="#ref-for-dfn-job">Install</a>
    <li><a href="#ref-for-dfn-job">Unregister</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-type">
   <b><a href="#dfn-job-type">#dfn-job-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-type">Appendix A: Algorithms</a>
    <li><a href="#ref-for-dfn-job-type">Create Job</a> <a href="#ref-for-dfn-job-type">(2)</a>
    <li><a href="#ref-for-dfn-job-type">Run Job</a> <a href="#ref-for-dfn-job-type">(2)</a> <a href="#ref-for-dfn-job-type">(3)</a>
    <li><a href="#ref-for-dfn-job-type">Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-scope-url">
   <b><a href="#dfn-job-scope-url">#dfn-job-scope-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-scope-url">Appendix A: Algorithms</a> <a href="#ref-for-dfn-job-scope-url">(2)</a> <a href="#ref-for-dfn-job-scope-url">(3)</a>
    <li><a href="#ref-for-dfn-job-scope-url">Create Job</a>
    <li><a href="#ref-for-dfn-job-scope-url">Register</a> <a href="#ref-for-dfn-job-scope-url">(2)</a> <a href="#ref-for-dfn-job-scope-url">(3)</a>
    <li><a href="#ref-for-dfn-job-scope-url">Update</a>
    <li><a href="#ref-for-dfn-job-scope-url">Unregister</a> <a href="#ref-for-dfn-job-scope-url">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-script-url">
   <b><a href="#dfn-job-script-url">#dfn-job-script-url</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-script-url">Appendix A: Algorithms</a>
    <li><a href="#ref-for-dfn-job-script-url">Create Job</a>
    <li><a href="#ref-for-dfn-job-script-url">Register</a> <a href="#ref-for-dfn-job-script-url">(2)</a> <a href="#ref-for-dfn-job-script-url">(3)</a>
    <li><a href="#ref-for-dfn-job-script-url">Update</a> <a href="#ref-for-dfn-job-script-url">(2)</a> <a href="#ref-for-dfn-job-script-url">(3)</a> <a href="#ref-for-dfn-job-script-url">(4)</a> <a href="#ref-for-dfn-job-script-url">(5)</a> <a href="#ref-for-dfn-job-script-url">(6)</a> <a href="#ref-for-dfn-job-script-url">(7)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-worker-type">
   <b><a href="#dfn-job-worker-type">#dfn-job-worker-type</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-worker-type">3.2.5. update()</a>
    <li><a href="#ref-for-dfn-job-worker-type①">Update</a> <a href="#ref-for-dfn-job-worker-type②">(2)</a>
    <li><a href="#ref-for-dfn-job-worker-type③">Soft Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-client">
   <b><a href="#dfn-job-client">#dfn-job-client</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-client">Create Job</a>
    <li><a href="#ref-for-dfn-job-client">Resolve Job Promise</a> <a href="#ref-for-dfn-job-client">(2)</a> <a href="#ref-for-dfn-job-client">(3)</a> <a href="#ref-for-dfn-job-client">(4)</a>
    <li><a href="#ref-for-dfn-job-client">Reject Job Promise</a> <a href="#ref-for-dfn-job-client">(2)</a> <a href="#ref-for-dfn-job-client">(3)</a> <a href="#ref-for-dfn-job-client">(4)</a>
    <li><a href="#ref-for-dfn-job-client">Register</a> <a href="#ref-for-dfn-job-client">(2)</a>
    <li><a href="#ref-for-dfn-job-client">Update</a> <a href="#ref-for-dfn-job-client">(2)</a>
    <li><a href="#ref-for-dfn-job-client">Unregister</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-promise">
   <b><a href="#dfn-job-promise">#dfn-job-promise</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-promise">Create Job</a>
    <li><a href="#ref-for-dfn-job-promise">Schedule Job</a>
    <li><a href="#ref-for-dfn-job-promise">Resolve Job Promise</a> <a href="#ref-for-dfn-job-promise">(2)</a>
    <li><a href="#ref-for-dfn-job-promise">Reject Job Promise</a> <a href="#ref-for-dfn-job-promise">(2)</a>
    <li><a href="#ref-for-dfn-job-promise">Install</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-list-of-equivalent-jobs">
   <b><a href="#dfn-job-list-of-equivalent-jobs">#dfn-job-list-of-equivalent-jobs</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-list-of-equivalent-jobs">Schedule Job</a>
    <li><a href="#ref-for-dfn-job-list-of-equivalent-jobs">Resolve Job Promise</a>
    <li><a href="#ref-for-dfn-job-list-of-equivalent-jobs">Reject Job Promise</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-force-bypass-cache-flag">
   <b><a href="#dfn-job-force-bypass-cache-flag">#dfn-job-force-bypass-cache-flag</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-force-bypass-cache-flag">Soft Update</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-equivalent">
   <b><a href="#dfn-job-equivalent">#dfn-job-equivalent</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-equivalent">Schedule Job</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="dfn-job-queue">
   <b><a href="#dfn-job-queue">#dfn-job-queue</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dfn-job-queue">Appendix A: Algorithms</a> <a href="#ref-for-dfn-job-queue">(2)</a> <a href="#ref-for-dfn-job-queue">(3)</a> <a href="#ref-for-dfn-job-queue">(4)</a> <a href="#ref-for-dfn-job-queue">(5)</a> <a href="#ref-for-dfn-job-queue">(6)</a>
    <li><a href="#ref-for-dfn-job-queue">Schedule Job</a> <a href="#ref-for-dfn-job-queue">(2)</a> <a href="#ref-for-dfn-job-queue">(3)</a> <a href="#ref-for-dfn-job-queue">(4)</a>
    <li><a href="#ref-for-dfn-job-queue">Run Job</a> <a href="#ref-for-dfn-job-queue">(2)</a>
    <li><a href="#ref-for-dfn-job-queue">Finish Job</a> <a href="#ref-for-dfn-job-queue">(2)</a> <a href="#ref-for-dfn-job-queue">(3)</a> <a href="#ref-for-dfn-job-queue">(4)</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>